Random Color Generator

Pick the kind of colour you want, pastel, vivid, dark or any, and how many. Each swatch shows its hex, RGB and HSL codes, ready to copy.

How it works

Any colour draws three random bytes, one each for red, green and blue, so all 16.7 million colours a screen can show are equally likely.

Pastel, vivid and dark fix a range of saturation and lightness and draw the hue freely. Pastels are light and soft, vivid colours are bright and strong, and dark colours are deep shades.

Every draw uses your browser's secure random generator. Nothing is uploaded.

How to use it

  1. 1 Pick Any colour, Pastel, Vivid or Dark.
  2. 2 Type how many colours you want, up to 100.
  3. 3 Press New colours until you see ones you like.
  4. 4 Copy a single hex code, or all of them from the box below the swatches.

Good to know

  • Pastels work as backgrounds behind dark text. Vivid colours work as accents, used sparingly.
  • Check any text colour for contrast against its background before you use it in a design.
  • Paste the HSL code into your CSS and change only the lightness to make lighter and darker versions.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Random colours, and why families help

A screen makes every colour from red, green and blue light, each at a level from 0 to 255. That gives 256 × 256 × 256 = 16,777,216 colours. A hex code writes the three levels in base 16: #FF0000 is full red with no green or blue. The same colour is rgb(255, 0, 0) in RGB and hsl(0, 100%, 50%) in HSL, and every swatch here shows all three.

Drawing a fully random colour is easy: take three random bytes. The results are fair, but most of them look dull. A typical draw has all three channels somewhere in the middle, which gives greys, browns and olive greens. Pure, bright colours need one channel high and another low, and those are a small share of all the possibilities.

That is why the tool offers families. HSL describes a colour by hue, its place on the colour wheel from 0 to 360 degrees, saturation, how strong it is, and lightness, how close it is to white or black. A pastel here has saturation from 50 to 80 percent and lightness from 80 to 90 percent. A vivid colour has saturation from 80 to 100 percent and lightness near 50. A dark colour has lightness from 15 to 30 percent. Within a family the hue is free, so a set varies in colour but agrees in mood.

A worked example: a teacher wants six different background colours for groups on a slide, light enough for black text. Picking Pastel and 6 gives six light colours such as hsl(200, 65%, 85%). Black text on that background has a contrast ratio of more than 14 to 1, far above the 4.5 to 1 that the WCAG accessibility guidelines ask for in body text.

There are limits. Colours are drawn independently, so two in one set can look almost the same; press New colours for another set. The families are ranges in HSL, which does not match human perception exactly, so a yellow and a blue at the same lightness can look quite different in brightness. The tool does not build harmonious palettes or check contrast for you.

Frequently asked questions

What is the difference between hex, RGB and HSL?

They describe the same colour in different ways. Hex, such as #FF8800, is red, green and blue in base 16. RGB writes the same three values from 0 to 255. HSL gives hue as an angle on the colour wheel, then saturation and lightness as percentages.

Why do "Any colour" results often look muddy?

Because most of the 16.7 million colours are mid-tones that mix all three channels. A random byte for each channel rarely gives a pure, bright colour. Pick Vivid or Pastel to stay in a nicer family.

Can I get a whole matching palette?

Not here: each colour is drawn on its own, so a set is random rather than planned. Picking one family, such as Pastel, does make a set sit together better.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.