Skip to content
Jellykit

Random Color Generator

Generate one random color or up to 100 at once as HEX, RGB or HSL, limited to the hues, saturation and lightness you choose.

  • Runs on your device
Loading tool

About Random Color Generator

Press Generate for a random color, shown as a swatch with its HEX, RGB and HSL values ready to copy, or ask for up to 100 at once and download them as a text file.

Narrow the result when you need to: a hue range such as 180° to 260° for blues and teals, or one that wraps through red such as 330° to 30°, and minimum and maximum saturation and lightness for pastels, darks or muted tones.

How it works

  1. Each color is drawn as whole-number HSL values: a hue from the range you set (wrapping past 360° when the end is lower than the start), then a saturation and a lightness from their ranges.
  2. Every allowed value is equally likely. The numbers come from the browser’s cryptographic random generator, with rejection sampling so that no value is favoured.
  3. The HSL color is converted to RGB with the CSS formula and rounded to 8 bits per channel, which also gives the HEX code.

Questions

Why are so many colors dull or very dark?

With the full ranges, every saturation and lightness is equally likely, and many of those combinations are greys, near-blacks and near-whites. Raise the lowest saturation to about 50% and keep lightness between 35% and 75% for livelier colors.

How do I get pastel colors?

Set saturation to roughly 40% to 80% and lightness to 80% to 90%. For dark, rich colors try lightness 15% to 35% with saturation above 60%.

Is the HSL value exact?

Yes, the HSL value is the one that was drawn. The RGB and HEX values are that color rounded to whole 8-bit channels, which is what screens display.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.