Random Color Generator

Generate random colors in HEX, RGB, HSL, and OKLCH with one click or continuously.

Image ToolsFreeNo Signup
Random Color Generator
Free Tool

How to use Random Color Generator

Need a color to start with? Stuck choosing between shades? Want to generate a random palette for a design prototype? The Random Color Generator gives you instant, truly random colors in every format you need, with controls to guide the randomness toward colors that actually work. Basic usage: Click Generate Color for a single random color shown in HEX, RGB, HSL, and OKLCH simultaneously. All four format values are displayed and each has its own one-click copy button. Press Space or click Generate again to get the next random color. Lock specific channels: Prevent specific color components from changing between generations. Lock the Hue slider to keep colors in the same color family — for example, locking hue at 220° always generates blues. Lock Saturation to keep colors at the same vividness. Lock Lightness to stay in the same brightness range. These locks let you explore variations of a color direction without fully random results. Brightness range control: Set a minimum and maximum lightness range to avoid colors that are too dark to use on dark backgrounds or too washed out to use on light backgrounds. Keep the range between 25% and 75% lightness for colors that work reliably in UI contexts. Generate a palette: Switch to Palette Mode to generate 5 or 10 colors at once. All colors are randomly generated independently. Use this as a starting point for a design system, a brand palette, or choosing chart colors. Each color in the palette has its own copy button. Favorite colors: Click the heart icon on any generated color to save it to your favorites list for the session. This lets you keep good colors as you continue generating and explore without losing discoveries. Copy in any format: Copy HEX for CSS and design tools, RGB for CSS color functions and JavaScript, HSL for color manipulation in CSS, or OKLCH for perceptually uniform color work in modern CSS. All values are formatted and ready to paste.

Frequently Asked Questions

How random is the color generation?

Colors are generated using Math.random() seeded by the browser — truly random within the allowed range. Each color component (hue, saturation, lightness) is generated independently. If you have locked specific channels, only the unlocked channels are randomized. For cryptographically random values, this tool is not designed for security use — it is purely for design and visual work.

What is the difference between HEX, RGB, HSL, and OKLCH?

HEX and RGB both describe colors by red, green, and blue channel values — HEX uses base-16 notation (#FF5733) and RGB uses decimal (rgb(255, 87, 51)). HSL uses hue, saturation, and lightness — more intuitive for adjusting colors. OKLCH is a perceptually uniform format used in modern CSS where equal numeric steps produce equal perceived changes in lightness and chroma.

Can I use the generated colors directly in CSS?

Yes. All four formats are valid CSS color values. HEX is the most widely used in stylesheets. RGB and HSL are valid in both the legacy rgb(255, 87, 51) syntax and the modern rgb(255 87 51) space-separated syntax. OKLCH is supported in all modern browsers and is the recommended format for new CSS color work due to its perceptual uniformity.

What does locking a color channel do?

Locking a channel — hue, saturation, or lightness — keeps that value fixed while the unlocked channels continue to randomize. For example, locking hue at 210° means every generated color will be a blue, varying only in saturation and lightness. This is useful when you need color variety within a specific color family for a design palette.

Can I generate a full color palette instead of single colors?

Yes. Switch to Palette Mode to generate 5 or 10 colors simultaneously. Each color is generated independently and randomly. Use the generated palette as a starting point for a design system or a chart color scheme. You can regenerate the full palette or lock individual colors while regenerating the rest.

Recommended

Related Tools