How to generate a random color
- Press Generate color or hit the Space key: a random color fills the whole panel and shows its code.
- Click the HEX, RGB or HSL value under the button to copy it.
- Choose the Tone: any, pastel, vivid or dark.
- For a palette, set the number of colors, up to 8, and the Palette type: random, analogous, complementary, triadic or monochrome.
- Click a stripe to copy its HEX code, copy all the codes at once, or share the link to the palette.
What a random color is useful for
- Design and illustration. A random color pulls you away from your usual shades: generate until one catches your eye, then build a palette around it.
- An accent for a website or a presentation. Take the vivid tone and a complementary palette: one color for buttons and headings, its opposite for highlights.
- Test data for CSS. Give every block of a layout its own background, and you see at once where it begins and ends.
- A color for a team or a character. Give each team from the team generator a color of its own, or let chance choose a hero's cloak or hair.
- Drawing challenges. Limit yourself to three random colors; for a subject, add a random animal.
- Art lessons. Show a complementary or triadic palette in full screen to explain how colors work together.
Need a plain color name for a children's game, not a code? Spin the wheel of ten basic colors.
What this color generator can do
- One color, three notations. HEX, RGB and HSL — for example
#3FA7D6,rgb(63, 167, 214)andhsl(199, 65%, 54%). Click any value to copy it. - Palettes of up to 8 colors. Several colors appear as stripes. Click a stripe to copy its HEX code; a separate button copies all the codes.
- Tone. Any, pastel, vivid or dark — one mood for all the colors.
- A link to the palette. The colors are stored in the address itself, so it opens the same palette on any device.
- Full-screen mode, a strip of recent colors (a click copies the code) and the Space key for the next color.
Palette types: from analogous to monochrome
The Palette field sets how several colors relate to each other.
| Palette | How the colors relate | Good for |
|---|---|---|
| Random | Each color is picked independently | Surprises, test data |
| Analogous | Neighbors on the color wheel | Calm, harmonious layouts |
| Complementary | Opposite colors on the wheel | Contrast and accents |
| Triadic | Three colors evenly spaced on the wheel | Lively, balanced schemes |
| Monochrome | One hue in different lightness | Interfaces, charts, backgrounds |
Is the color really random?
Yes. Every color is drawn with crypto.getRandomValues() — the cryptographically secure generator built into every modern browser and seeded by your operating system. With the tone set to any, every shade has the same chance; pastel, vivid and dark only narrow the range the color is drawn from. In every palette type except random, chance picks the first color and the palette rule places the others. More in the article on how the randomness works.
Frequently asked questions
How do I get a random HEX color?
Press Generate color: the HEX code, such as #3FA7D6, is written on the color and repeated under the button, next to RGB and HSL. Click it to copy. Its six digits — two each for red, green and blue — allow 16,777,216 colors.
What is the difference between HEX, RGB and HSL?
They are three ways to write the same color. RGB gives the amounts of red, green and blue, each from 0 to 255. HEX is the same three numbers in hexadecimal, the usual web notation. HSL means hue, saturation and lightness: change one number to get a lighter or calmer color.
How do I make a random color palette?
Set the number of colors from 2 to 8 and press Generate color — they appear as stripes. A random palette gives unrelated colors; an analogous, complementary, triadic or monochrome one gives colors that go together.
Can I generate only pastel colors?
Yes. Set Tone to pastel, and every color comes out soft and light. Vivid gives saturated colors for accents, dark gives deep shades for backgrounds, and any removes the limit.
Does the color generator show color names?
No, only codes: HEX, RGB and HSL. A name such as “teal” covers thousands of shades, while a code points to exactly one — which is what a stylesheet needs.