Random Color Generator

Random colors

Roll a random color from the full 24-bit RGB space and see it rendered as a large swatch with every common representation beside it: hex (#a3e1b4), RGB (rgb(163, 225, 180)), HSL and even CSS named-color fallback when one matches. Click the swatch to roll again.

How to generate a random color

  1. 1

    Click generate

    Three random bytes (0-255) become the R, G and B channels.

  2. 2

    Read every format

    Hex, RGB, HSL and HSV are all displayed; copy whichever your stylesheet uses.

  3. 3

    Lock if you like it

    If the result is close to what you want, toggle "lock hue" to keep the hue and re-roll only lightness and saturation.

The color space

The generator draws from 24-bit RGB, giving 16,777,216 possible colors. That is the same gamut your monitor can display, though some of those values land in the darker or desaturated corners that are hard to tell apart.

How each format represents the same color

Format Syntax Bytes per channel
Hex #RRGGBB 8 bits
RGB rgb(R, G, B) 8 bits
HSL hsl(H, S%, L%) Derived
HSV hsv(H, S%, V%) Derived
OKLCH oklch(L C h) Perceptually uniform

Why purely random can look muddy

Uniform random RGB lands in perceptually dark, desaturated colors more often than bright vivid ones. If you need punchier results, re-roll using HSL with saturation locked above 60% and lightness between 45% and 65% — you will get magazine-cover colors instead of mud.

Accessibility

Pair any generated color against white or black text and check the WCAG contrast ratio before using it as a button background. For body text the minimum is 4.5:1; for large text it is 3:1.

Frequently Asked Questions

Because most of RGB space sits in the dark, desaturated middle. Only a thin shell near the edges contains vivid colors. Generate in HSL or OKLCH with bounded saturation for lively results.

Use the hue-locked mode (if exposed): you pick a hue in degrees and the tool rolls only saturation and lightness. Useful for exploring tones of a brand color.

No seeded mode at the moment — each click is an independent draw from the crypto RNG. Copy the hex code to preserve a color.

Roughly. Hex codes are device-relative; a calibrated sRGB display shows them accurately, a cheap laptop shifts them toward blue. For print, convert to CMYK before trusting the appearance.

Related Tools