Generate random colors on demand — truly random across the whole sRGB space, or constrained to balanced, pastel, dark or vivid styles that are generated in OKLCH so every roll is usable. Get up to 24 at once as hex codes, CSS variables or JSON.
Settings
Generated locally in your browser — your settings and results never leave this page.
Randomness, disciplined
True randomness across the RGB cube is a legitimate but harsh request — most of that space is murky brown-gray, which is why “surprise me” tools that sample it uniformly disappoint. The styled modes here impose the two constraints that separate usable from arbitrary: a lightness band and a chroma band in OKLCH. Hue stays fully random — variety survives — but every roll lands in territory a designer might actually keep.
The mode names describe their envelopes honestly: balanced sits mid-lightness at moderate chroma; pastel high-light low-chroma; dark low-light restrained-chroma; vivid mid-light high-chroma. Truly-random remains available for when you genuinely want the whole cube — stress-testing UI against arbitrary user colors is its best use.
What random colors are for
More than inspiration: placeholder states during development (real-looking data beats gray boxes), chart series while the real palette is undecided, generative art seeds, testing color-handling code against unexpected inputs, and breaking design fixation — ten random vivids can dislodge a stuck palette conversation faster than an hour of deliberate picking.
The ephemerality contract
Every control change rerolls — stated in the interface, worth restating here: copy before you touch anything. This is deliberate design, not oversight: a random generator that tried to preserve state would be a worse random generator. Reproducibility belongs to the seeded tools — Palette From HEX and the OKLCH Palette Generator derive identical output from identical input, every time.
From roll to system
A promising random color is a seed, not a system. Feed it to Palette From HEX for a coordinated five, to Shades & Tints for its ramp, through the Contrast Checker before it carries text. The generator’s job ends at “interesting”; the linked tools handle “correct”.
The envelopes, in numbers
Each style constrains OKLCH lightness and chroma to a documented band while hue stays free. The exact envelopes:
| Style | Lightness (L) | Chroma (C) | Character |
|---|---|---|---|
| Truly random | unconstrained | unconstrained | the whole cube, mud included |
| Balanced | 0.55 – 0.80 | 0.08 – 0.20 | usable defaults |
| Pastel | 0.85 – 0.93 | 0.03 – 0.09 | soft fills |
| Dark | 0.25 – 0.40 | 0.04 – 0.14 | backgrounds, depths |
| Vivid | 0.55 – 0.72 | 0.19 – 0.29 | accents, toward gamut edge |
The envelopes are honest documentation, not marketing: any color a style produces satisfies its row, and any color satisfying the row could have been produced. To explore an envelope deterministically instead of by dice, set the same bounds in the OKLCH Palette Generator and sweep hue by hand.
How to use the Random Color Generator
- Choose how many colors and a style – truly random, balanced, pastel, dark or vivid.
- Every control change (or the Random button) rolls a fresh set.
- Copy hex codes, CSS variables or JSON before rolling again.
Frequently asked questions
How random are the colors, really?
Truly random mode samples all 16.7 million sRGB colors uniformly – which is honest but frequently ugly, since most of that space is murky. The styled modes constrain lightness and chroma in OKLCH so randomness lands in usable territory. Math.random drives both; this is inspiration, not cryptography.
Why do the styled modes produce nicer colors than pure random?
Because "nice" is mostly a lightness-and-chroma property, not a hue property. Pastel = high L, low C; vivid = mid L, high C; dark = low L, restrained C. Fixing those two knobs and randomizing hue gives endless variety that still hangs together.
Can I lock one color and reroll the rest?
Not on this page – that workflow belongs to the Color Palette Generator, which builds coordinated sets by mood. This tool optimizes for pure serendipity: roll, copy what sparks, roll again.
What are random colors actually useful for?
Placeholder UI states, chart series while prototyping, generative art seeds, picking a direction when the brief says "surprise me", and testing how layouts behave with arbitrary user colors – the last one being where truly-random mode shines.
Why did my copied palette disappear when I changed a control?
Every change rerolls by design – the tool warns you in the preview. Copy first, tweak second. If you need reproducible palettes, the seeded tools (Palette From HEX, OKLCH Palette) derive everything from inputs you control.
Do the same colors ever repeat?
With 16.7 million possibilities, repeats in one session are vanishingly unlikely in random mode and merely rare in styled modes. There is no memory between rolls – each set is independent.
Is there a keyboard-fast way to reroll?
The Random button is a real button – focus it once and press Enter/Space repeatedly. Every roll is announced to screen readers as a completed generation.