Generate six fully random colors at once, each shown with its HEX, RGB, and HSL values — useful for design inspiration, placeholder palettes, mockups, or picking a fresh accent color when you are stuck. Click any swatch to copy its HEX code.
How it works
For each swatch the tool picks three random channel values — red, green and blue — each an integer from 0 to 255. The random numbers come from the browser’s Web Crypto API (crypto.getRandomValues), and the tool uses rejection sampling to discard values that would bias the result, so every value 0–255 is exactly equally likely.
The RGB triplet is then formatted three ways: as a two-digit-per-channel HEX string, as rgb(r, g, b), and as hsl(h, s%, l%) computed with the standard RGB-to-HSL conversion (max/min of the normalised channels give lightness and saturation; the dominant channel gives hue). The tool also computes each color’s perceived luminance to choose readable label text.
Example
A generated swatch might be RGB (34, 197, 94). The tool shows it as:
- HEX:
#22C55E - RGB:
rgb(34, 197, 94) - HSL:
hsl(142, 71%, 45%)
Clicking the swatch copies #22C55E to your clipboard.
| Format | Example | Use |
|---|---|---|
| HEX | #22C55E | CSS, design tools |
| RGB | rgb(34, 197, 94) | CSS, canvas |
| HSL | hsl(142, 71%, 45%) | Tweaking hue/saturation |
Colors are generated in your browser and never leave your device.