Random colour generator — pastel, vivid, dark or grey swatches

Pick a style and the tool draws up to 100 random colours, shows each as a swatch, and lists its HEX, RGB and HSL values ready to paste into CSS or a design tool.

Live demo · real result from this tool

Press Generate to create a result.

Processed on your device — nothing is uploaded.

How to use the random colour generator

  1. Choose a Style: Any colour, Pastel, Vivid, Dark or Greys.
  2. Set How many colours, from 1 to 100 (6 by default).
  3. Press Generate. Swatches appear first, then a table with HEX, RGB and HSL for each colour.
  4. Copy the value in the format you need.

What it does and when to use it

Random colours help when you are stuck on a blank page, need placeholder colours for charts or avatars, want sample data for a colour picker, or are building a game or a classroom activity. The style setting is what makes the results usable: pure random colours are often muddy, while a pastel or vivid set looks intentional straight away.

To fine-tune a colour you like, open it in the colour picker. If you want the same input text to always give the same colour, as with user avatars, use the colour hash tool instead of random colours. For random hex values that are not colours, see the random hex generator.

How it works

Random numbers come from crypto.getRandomValues.

  • Any colour takes three random bytes and writes them as #rrggbb.
  • Pastel, Vivid and Dark draw a hue from 0 to 359 degrees and a saturation and lightness inside the style’s range, then convert HSL to RGB and HEX.
  • Greys draw one number from 0 to 255 and use it for red, green and blue.

The table converts each HEX back to rgb(r, g, b) and hsl(h, s%, l%), so all three columns describe exactly the same colour.

Worked examples

Sample output; your colours will differ.

  • Any colour, 3 swatches: #ab7034 (a warm brown, rgb(171, 112, 52)), #e6217f (a pink, hsl(331, 80%, 52%)) and #a0ab35 (an olive). The table header is always HEX | RGB | HSL.
  • Pastel: #a2f09d and #cc9df0, both 78% lightness in the HSL column.
  • Greys: #a5a5a5 and #fdfdfd. Because red, green and blue are equal, the HSL value always starts hsl(0, 0%,.

Limits and tips

  • There is no seed, so you cannot get the same set back. Copy colours you like before pressing Generate again.
  • Colours are sRGB only; no CMYK or Pantone values are given.
  • For accessible designs, check contrast between text and background before you use a random colour.

Frequently asked questions

What does each style produce?
Any colour picks from all 16.7 million RGB colours. Pastel keeps lightness between 78% and 88% with medium saturation. Vivid uses 80–100% saturation at 45–58% lightness. Dark uses 12–28% lightness. Greys have equal red, green and blue. In every style except Greys the hue is random.
Do the colours form a matching palette?
No. Each colour is drawn on its own, so they are not chosen to look good together. A style such as Pastel makes a set feel related, but for planned harmonies use a colour palette tool or pick related hues yourself.
Why is the HSL value slightly different from the style range?
The tool turns the chosen HSL values into a HEX colour, which rounds each channel to a whole number from 0 to 255. The HSL column is then worked out again from that HEX, so it can be off by a point.
Are random colours readable as text backgrounds?
Not always. Pastel colours suit dark text, and dark colours suit white text, but check contrast before using any colour behind text.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close