Random Color Generator
Click once for a random color with its HEX, RGB, and HSL codes. Copy it in one tap for free, keep a history of your last colors, or lock one you like.
What is a random color?
A random color is one color picked by chance from all 16,777,216 colors a screen can show. Each of the three RGB channels — red, green, and blue — can take 256 values from 0 to 255, so the total is 256 × 256 × 256 = 16,777,216 possible colors. Every click picks one of them with equal odds.
That number is why random colors feel surprising: the chance of getting the same color twice in a row is 1 in 16,777,216. You will see colors you would never have picked on purpose, which is the whole point — randomness breaks habits and shows new options.
The current random color, large
#09ABB6
rgb(9, 171, 182)
hsl(184°, 91%, 37%)
Click Generate in the tool above and this panel repaints with the new color.
How to use a random color
Click Generate, look at the color, and either copy it or click again. If the color is close to what you want but not quite right, lock it and use the shades generator or the mixer to adjust it — randomness finds the starting point, and the other tools refine it. If it is wrong, one more click costs nothing.
Random colors work best as a starting point, not a finished palette. Generate 5 to 10 colors, keep the 1 or 2 you like from the history strip, and build the rest of the design around those. A design built from 10 unrelated random colors looks noisy.
History strip — your last 12 colors, live
Click any swatch to bring that color back as the current color.
Lock a color you like
The lock keeps a good color on screen while you keep generating. Tap the lock on a color you like, and it stays as the current color even as you click Generate again — the new colors go to the history instead of replacing it. That way a lucky find is never lost to one extra click.
Locking is also how you compare: lock a color, generate a few more, and the history shows the new options next to the locked one. Pick the best of the set, unlock it, and copy its HEX code when you are ready.
Locked swatch
Not locked yet — lock a color in the tool above
#09ABB6
While a color is locked, new colors appear in the history strip beside it instead of replacing it.
Random colors for inspiration, not for decisions
Randomness is a brainstorming tool, not a design decision. A random color can spark an idea — a teal you had not considered, a warm brown for a background — but it does not know your brand, your audience, or your accessibility limits. Always check a random pick before you ship it.
That check has two steps: first, does the color fit the design, and second, does it pass contrast with the text that will sit on it. The contrast checker on this site tests any pair, so paste the random HEX code in there with your text color before you use it.
Random to check — one step, in the right order
Copy the HEX code from the tool above, paste it into the contrast checker with your text color, and check it against the 4.50:1 AA limit. (The site keeps picker state in the page, not in the URL, so the code travels on your clipboard, not in a link.)
Why 16,777,216 colors?
Screens build color from 3 channels of 8 bits each, and 2 to the power of 24 is 16,777,216. Each channel holds 8 bits, so it has 2^8 = 256 values; three channels together hold 24 bits, so the total is 2^24 = 16,777,216. That figure is called 24-bit color, and it is the standard for screens, photos, and the web.
The HEX code is simply those 3 channels written as 6 hex digits: 2 digits for red, 2 for green, 2 for blue. Each pair runs from 00 to FF, which is 0 to 255 in decimal — the same 256 values per channel, written in base 16.
Three channels, three axes — 256 × 256 × 256
256 × 256 × 256 = 16,777,216 — 65,536 × 256, or 2^24.
All color tools
21 tools, one topic — see About Hex Color Code Picker for who built this site.
- Color Picker from ImageUpload an image, click a pixel, and read its HEX code.
- Screen EyedropperSample any pixel on your screen.
- RGB to HEX ConverterTurn three RGB numbers into one HEX code.
- HEX to RGB ConverterTurn a HEX code into three RGB numbers.
- HEX to HSL ConverterTurn a HEX code into hue, saturation, and lightness.
- HSL to HEX ConverterTurn HSL values back into a HEX code.
- HEX to HSV ConverterTurn a HEX code into hue, saturation, and value.
- HEX to CMYK ConverterTurn a HEX code into approximate print values.
- RGB to HSL ConverterTurn RGB numbers into hue, saturation, and lightness.
- HEX to OKLCH ConverterTurn a HEX code into the modern OKLCH format.
- Color ConverterSee one color in every format at once.
- HEX to RGBA ConverterTurn a HEX code into RGB with transparency.
- Color Name to HEXLook up any of the 148 CSS named colors.
- Color Palette GeneratorBuild a five-color palette from one color.
- Shades GeneratorBuild 10 tints and 10 shades from one color.
- Gradient GeneratorBuild a linear or radial gradient and copy the CSS.
- Contrast CheckerCheck any text and background pair for AA and AAA.
- Color MixerMix two colors and see the result.
- Random Color GeneratorPick a random color from all 16,777,216 HEX colors.
- Color Blindness SimulatorSee your colors as color-blind users see them.
- Color ChartThe 148 named colors with HEX, RGB, and HSL.
No tool matches your search.
Frequently asked questions
It can make any of 16,777,216 colors — 256 × 256 × 256. Each RGB channel has 256 values from 0 to 255, so the total is 256 × 256 × 256 = 16,777,216. Every click picks one of them with equal odds.
Yes, but the chance is 1 in 16,777,216 for any single click. Repeats are so unlikely that you will practically never see one. If you do want a color back, the history strip keeps your last 12 colors — click one to bring it back.
Click the copy button under the HEX code, or click the swatch itself. The HEX code is copied with the # sign, ready to paste into CSS, Figma, or Canva. The RGB and HSL values are shown under the swatch if you need those instead.
The lock keeps a color you like on screen while you generate more. Tap the lock, keep clicking Generate, and the new colors go to the history strip instead of replacing the locked one. Unlock it when you are done comparing.
The history keeps your last 12 colors. Older colors drop off the end as new ones arrive. Click any history swatch to make it the current color again, or use Clear history to start fresh.
Not automatically — always check it with the contrast checker first. A random color can be too light for white text or too dark for black text. Paste the random HEX code into the contrast checker with your text color and check it against the 4.50:1 AA limit before you use it.