purr.tools

Random Color Generator

Generate random colors with their hex, RGB, and HSL values. Click a color swatch to copy its hex code.

Share this calculation

Copy this link to share your current inputs with anyone.

How to use the random color generator

Set the number of colors you want (1–20) and click Generate. Each color card shows the hex code, RGB values, and HSL values. Click the color swatch or the hex label to copy the hex code to your clipboard instantly.

Color format reference

HEX: a 6-digit hexadecimal code (e.g. #FF5733) used in HTML/CSS. RGB: red, green, blue values 0–255 (e.g. rgb(255, 87, 51)). HSL: hue (0–360°), saturation (0–100%), lightness (0–100%) — more intuitive for design work.

FAQ

Are the colors truly random?

Yes — each channel (red, green, blue) is independently and uniformly random from 0 to 255, giving 16.7 million possible colors. The distribution is uniform across the full RGB color space.

How do I use these colors in CSS?

Copy the HEX code and use it directly: color: #FF5733. Or use the RGB values: color: rgb(255, 87, 51). Or use HSL: color: hsl(11, 100%, 60%). All three formats are valid in modern CSS.

Embed this tool

Add this tool to your website by copying the snippet below.

<iframe
  src="https://www.purr.tools/en/embed/random-color-generator"
  width="100%"
  height="500"
  style="border:0;border-radius:8px;"
  loading="lazy"
  title="Random Color Generator — Free Online Tool"
  allow="clipboard-write"
></iframe>