Skip to content

Random Color Generator

Generate random colors in HEX, RGB, and HSL formats. Create palettes and copy color codes instantly.

Random Color Generator tool

Loading...

Example

Input: Click Generate Color

Result: A random color in three formats, for example HEX #C7481A, RGB rgb(199, 72, 26), HSL hsl(16, 77%, 44%)

A new color is drawn on every click and the HEX, RGB and HSL values always describe the same color. Lock Hue, Saturation or Lightness to keep that part fixed.

  1. Click "Generate Color" to create a random color with a large preview swatch.
  2. Click "Generate Palette (5 colors)" for a matched set, then click any swatch to load it into the preview.
  3. Turn on Lock Hue, Lock Saturation or Lock Lightness, then generate again to change only the unlocked parts.
  4. Copy the HEX, RGB or HSL code with the copy button next to it.
  5. Click any color in the history to bring it back.

How Random Colors Are Picked

This generator picks a random color and gives you its HEX, RGB and HSL codes, each with a copy button. Press Generate Color for one color, or Generate Palette (5 colors) for a small matched set.

Colors are built in HSL, which stands for hue, saturation and lightness. Hue is the spot on the color wheel, from 0 to 359 degrees. Saturation is how strong the color is, and lightness is how close it sits to black or white. The tool picks any hue at random. It keeps saturation between 30% and 95% and lightness between 25% and 75%, so you rarely get a dull gray or a color too dark or pale to use.

The lock toggles let you explore one idea at a time. Turn on Lock Hue and each click gives a new version of the same color family. Lock Lightness instead and every new color has the same brightness. That helps when chart labels or tags should all look equally strong. Your last 20 colors stay in the history, and clicking one brings it back.

The palette button starts from a random base hue and adds colors at 30, 60, 180 and 210 degrees around the wheel. You get two close neighbors plus an opposite pair, each with small random changes to saturation and lightness. Click any swatch to load it into the main preview. For named schemes such as triadic or complementary, use the Color Palette Generator. Before you use a random color for text, test it in the Color Contrast Checker.

Frequently Asked Questions

Click Generate Color. The tool shows a large swatch with the HEX code in capitals, such as #C7481A, plus the matching RGB and HSL values. Click the copy button next to the format you need and paste it into your CSS, design file or slide.
The generator keeps saturation between 30% and 95% and lightness between 25% and 75%. That rules out near-grays, near-black and near-white results, which are rarely what people want from a random color. Hue is not limited, so any color family on the wheel can come up.
Lock Hue keeps the current position on the color wheel and only changes saturation and lightness when you generate again. You get new tints and shades of the same color family. Lock Saturation and Lock Lightness work the same way for their own values, and you can turn on more than one lock at a time.
Yes. The tool picks whole-number HSL values first, then converts them to HEX and RGB. The HEX and RGB codes are exact matches of each other. Converting that HEX code back to HSL can give a value one step off, because each format rounds to whole numbers.

Related Tools

Hex to RGB Converter

Convert hexadecimal color codes to RGB values instantly. Supports shorthand and 8-digit hex with alpha.

Color Tools

Color Palette Generator

Generate harmonious color palettes. Create complementary, analogous, triadic, and split-complementary schemes.

Color Tools

Color Picker

Pick any color visually and get values in hex, RGB, HSL, and CMYK. Interactive saturation panel and hue slider.

Color Tools

Color Shade and Tint Generator

Generate shades and tints of any color. Create darker and lighter variations for complete color scales.

Color Tools

Gradient CSS Generator

Create CSS gradients with a visual editor. Build linear, radial, and conic gradients with live preview.

Color Tools