Random Color Generator
Generate random colors in HEX, RGB and HSL with one click. Great for design inspiration, palettes, UI testing and beating creative block.
How color is represented in computing
A digital color is a numeric triplet (or quadruple, with alpha) under a specific color model. The most common ones in the browser are RGB (Red/Green/Blue, additive, used by monitors), HEX (RGB in hexadecimal — #RRGGBB), RGBA (RGB plus an alpha channel for opacity, 0-255 or 0.0-1.0), and HSL (Hue 0-360°, Saturation 0-100%, Lightness 0-100%), which is intuitive for humans and is the canonical CSS model.
With 8 bits per channel, RGB gives 24-bit color — about 16.7 million unique combinations. Print and design pipelines also use CMYK (Cyan/Magenta/Yellow/Key, subtractive, used by printers), Lab / CIELAB (perceptually uniform — used to compute color differences with ΔE), and HSB/HSV (Hue/Saturation/Value, similar to HSL but with Value instead of Lightness). Modern CSS adds OKLCH and HWB from CSS Color Module 4 — OKLCH is essentially a perceptually-uniform replacement for HSL and is the most accurate way to interpolate between two colors.
Wide gamut and P3
Standard monitors use the sRGB gamut. Modern displays (recent MacBooks, iPhones, professional monitors) cover the Display P3 gamut, which can show roughly 50% more colors than sRGB — especially saturated reds and greens. CSS Color 4 lets you target P3 explicitly with color(display-p3 r g b).
Why pure RGB random looks ugly
Picking R, G, B uniformly at random from 0-255 produces a lot of muddy browns, grays and dark colors — the visually "interesting" portion of the RGB cube is a small fraction of the total. A better approach is to randomize in HSL with bounded Saturation and Lightness, for example S ∈ [40, 80] and L ∈ [40, 60], which keeps colors vivid and readable. For an even smoother distribution, pick a hue at random and sample S/L from a normal distribution around the centre.
Accessibility: WCAG contrast and color blindness
When using random colors in a UI, always re-check contrast. The WCAG standard requires 4.5:1 contrast for normal body text (level AA) and 7:1 for AAA. Roughly 8% of men and 0.5% of women have some form of color blindness — protanopia (red-weak), deuteranopia (green-weak) and tritanopia (blue-weak) are the most common. Never use color as the only way to convey information.
FAQ
Why is "random color" almost always disappointing? Because the RGB cube is mostly dull — most of the visually interesting colors live in a thin shell. Generators that look good in practice randomize in HSL/OKLCH with clamped saturation and lightness.
Can the tool produce a full palette (analogous, complementary, triadic)? Yes — derive palettes by shifting hue: complementary is H + 180°, triadic is H ± 120°, analogous is H ± 30°, and split-complementary is H + 150° and H + 210°.
Should I use HEX, RGB or HSL in my CSS? Any of them work. HEX is shortest, RGB plays well with opacity, HSL is the easiest to tweak by hand. For modern projects, consider OKLCH for interpolations and gradients — the result looks far more natural.
Does Tailwind or Material Design relate to this? Yes. Tailwind uses a fixed scale of 50–950 per hue (slate-100 ... slate-900) where each step is roughly a fixed perceptual delta. Material Design 3 uses dynamic color tokens derived from a single seed hue, which is essentially OKLCH-based generation under the hood.
Related Tools
Random Date Generator
Generate random dates within a defined range — useful for seeding test databases, app fixtures or mock spreadsheets.
Random AA Contrast Color Generator
Generate random color combinations that already pass WCAG AA (4.5:1) contrast for text and background. Build accessible, readable palettes without manual testing.
Random String Generator
Generate customizable random strings — set the alphabet (A-Z, a-z, 0-9, hex, base32, base58, symbols), length and quantity. Useful for tokens, IDs and fixtures. Everything in your browser.
Random Time Generator
Generate random times (HH:MM:SS) within a window.
Approximate CMYK Paint Color
Approximates a digital RGB color as a physical paint mix (CMYK + white) — useful for traditional artists.
Design Doc Template Generator
Generate a software engineering Design Doc template, with sections for context, proposal, alternatives and plan. Document technical decisions and align your team.