Random Color Generator

Generate random colors free online — HEX, RGB & HSL codes with click-to-copy swatches and palette history. No sign-up, instant, perfect for designers.

  • ✓ Free forever
  • ✓ No sign-up
  • ✓ Private — runs in your browser

Loading tool…

About this random color generator

A random color generator gives you a brand-new color in one click — ideal when a design needs a spark or you are stuck choosing. Each click shows a fresh color in the swatch preview with its HEX, RGB, and HSL codes ready to copy. It is free, instant, and needs no sign-up.

This tool is for designers mocking up layouts, developers styling components, artists hunting for palette ideas, and teachers making colorful classroom materials. You click “Generate color” and the swatch preview updates immediately; the “HEX”, “RGB”, and “HSL” rows each carry their own “Copy” button so the code you need is one click away. Every color you generate is appended to your “Palette history”, so you can scroll back and reuse earlier picks. When the list gets long or you want a fresh start, “Clear history” wipes it clean.

Everything runs entirely in your browser. Each color is generated on your device — nothing is sent to a server, stored, or logged. There is no pattern to the sequence, and no limit to how many colors you can generate.

How to use it

  1. Click "Generate color" — a new color appears in the swatch preview.
  2. Read the "HEX", "RGB", and "HSL" rows and click "Copy" on the format you need for your design tool or code.
  3. Browse your "Palette history" to revisit earlier colors, and click "Clear history" to wipe the list and start over.

The method behind it

Each color draws three random bytes from crypto.getRandomValues(), the browser's cryptographic random number generator — one byte each for the red, green, and blue channels. That 24-bit RGB value is then converted into its HEX (#RRGGBB) and HSL (hue, saturation, lightness) representations using the standard formulas, so all three rows always describe the same color. With 256 possible values per channel, there are 256³ = 16,777,216 possible colors, and every one of them is equally likely on each click. The "Palette history" list simply records what you have already generated in this session; it does not influence what comes next.

Frequently asked questions

Are the colors truly random?

Yes. Each color comes from three cryptographic random bytes generated on your device, giving every one of the 16,777,216 possible colors an equal chance on every click. There is no pattern, no sequence, and no way to predict the next color.

How do I copy a color code?

Click the "Copy" button next to the "HEX", "RGB", or "HSL" row — whichever format your design tool or code editor needs. The value is copied to your clipboard immediately, ready to paste into Figma, Photoshop, CSS, or anywhere else.

Does my palette history get saved anywhere?

No. The "Palette history" list lives only in your current browser tab and disappears when you click "Clear history" or close the page. Nothing is sent to a server or stored, so your color exploration stays completely private.

Can I use these colors in my designs for free?

Absolutely. Every generated color is yours to use — in websites, apps, logos, presentations, and artwork — with no attribution required. HEX, RGB, and HSL are universal formats accepted by all major design tools and CSS.

Worked example

The chance of generating one specific color — say pure red, #FF0000 — on any single click is exactly 1 in 16,777,216 ≈ 0.000006%. But repeats arrive sooner than most people expect: by the birthday paradox, after about √(π/2 × 16,777,216) ≈ 5,130 clicks you reach a 50% chance that at least two clicks produced the exact same color. So if you notice a duplicate in a long session, that is mathematics working as intended, not a flaw.

Related tools