RANDOM COLOR

Generate a random color with its HEX, RGB and HSL code

Recent colors

What is the random color generator?

It's a tool that creates a random color every time you tap it and shows you its code in HEX, RGB and HSL, the standard formats used in design and CSS, along with an approximate name for the color. A drop of ink fills the whole swatch so you can see it large, and you copy the code with a tap.

It's perfect for finding inspiration when you don't know which color to use, discovering new combinations, or simply letting chance pick a palette for you.

What can a random color be used for?

  • Web design and CSS: copy a color in HEX or RGB and paste it into your stylesheet.
  • Creative inspiration: break away from your usual colors and discover new shades.
  • Illustration and art: pick a random starting palette.
  • Deciding between options by assigning a color to each.
  • Games and challenges about guessing or matching colors.

How does it work?

Each color is generated by randomly choosing a value from 0 to 255 for each of the three channels (red, green and blue) with the browser’s cryptographic generator (crypto.getRandomValues()). The combination of those three values makes the final color, shown in HEX (#RRGGBB) and RGB. There are over 16.7 million possible colors, so a repeat is very unlikely.

The color code is computed and copied inside your browser; nothing is sent to any server. The history keeps the session's last colors in case you want them back.

Frequently asked questions

What is a HEX code?

It's the way to write a web color with a hash and six hexadecimal digits (#RRGGBB): two for red, two for green and two for blue. It's the most common format in CSS and design.

How do I copy the color?

Tap the HEX, RGB or HSL code and it is copied to your clipboard, ready to paste into your editor, CSS or design tool.

How many colors can it generate?

Just over 16.7 million: 256 possible values for each channel (red, green and blue), that is 256 × 256 × 256 combinations.

Is it useful for web design and CSS?

Yes. It gives you the color in HEX and RGB, the two standard CSS formats, so you can paste it straight into your stylesheet or design tool.

Are the colors really random?

Yes. Each color channel is generated with the browser's cryptographic generator, so each color is independent of the previous one. Everything happens in your browser.

What's the difference between HEX, RGB and HSL?

They're three ways of writing the same color. HEX (#RRGGBB) is the most used in web and design. RGB states the amount of red, green and blue (from 0 to 255). HSL uses hue, saturation and lightness, and is the most intuitive for lightening or darkening a color or finding similar shades. The tool gives you all three so you can copy whichever you need.

What can I use a random color for?

To get past creative block: picking a color for a logo, an illustration or a room, drawing challenges or trying combinations on a website. If you do not like it, generate another: every time you get a new random colour.

How do I use the random hex color in my design?

Tap the HEX code (for example, #3A7BD5) to copy it and paste it into your CSS, Figma, Canva or drawing app. If the app asks for RGB or HSL, copy those values instead.

Related guides

  • Help me decide: 10 quick tricks — From two-pass elimination to the coin trick: ten ways to get unstuck today, sorted from most rational to most fun.
  • Why decisions are so hard — The science of indecision: the jam experiment, decision fatigue, maximizers vs satisficers — and what to actually do about all of it.