Home / Design tools / Random color

Random Color Generator

Press Generate, or the space bar, to get a random color. See its HEX, RGB, HSL and CMYK codes, the closest CSS color name, and how readable text is on it.

or press the space bar

Color codes

Text contrast

History

How to use the random color generator

Press the Generate button, or tap the space bar, and a new random color appears with its codes. Click a code to copy it. The last colors you made are kept in the history strip, so if you see one you like and then press Generate by mistake, you can click it to bring it back.

Choose a style or a hue

By default the generator picks any color, with each of the red, green and blue values chosen at random, so every one of the 16,777,216 colors that a screen can show is equally likely. Use the Style box to narrow the choice:

  • Vivid: strong, saturated colors.
  • Pastel: soft, light colors with some color in them.
  • Light and Dark: colors that are bright or deep.
  • Muted: dusty, low-saturation colors.

The Hue box limits the color family, for example only blues or only greens. The style and hue combine, so you can ask for a pastel pink or a dark green.

The color codes

CodeWhat it is
HEXSix hexadecimal digits, two each for red, green and blue, such as #3A7BD5. The standard in CSS and design tools.
RGBRed, green and blue amounts from 0 to 255, as in rgb(58, 123, 213).
HSLHue as an angle from 0 to 360 degrees on the color wheel, then saturation and lightness in percent. It is the easiest form to adjust by hand.
CMYKCyan, magenta, yellow and black percentages for print. This is a simple conversion, because real print colors depend on the printer and paper.

Is the text readable on it?

Below the codes you can see how white and black text look on the color, with their contrast ratios. The Web Content Accessibility Guidelines ask for a ratio of at least 4.5 to 1 for normal text (level AA) and 3 to 1 for large text. Level AAA asks for 7 to 1. The tool shows which levels each text color meets.

Inspect a color of your own

Type a hex code in the box, or use the color picker, and the same codes and the closest CSS name are shown for it.

Need more than one? Use the random hex color generator or the random RGB color generator for lists, or the random palette generator for colors that work together.

Frequently asked questions

How does the random color generator work?

It picks a random value from 0 to 255 for red, green and blue using your browser secure random number generator, then shows the result as HEX, RGB, HSL and CMYK.

How many colors are possible?

16,777,216, which is 256 values for each of red, green and blue.

Can I get only pastel or dark colors?

Yes. Choose a style such as pastel, dark, light, vivid or muted, and optionally a hue.

Does it work offline or send data anywhere?

The colors are made in your browser and nothing is sent to a server.