COLOR TOOLS
Random Color Generator
Generate a random color and read it as HEX, RGB, and HSL, or build a palette of three to six colors. Every color is created locally in your browser.
STEP 1
Single random color
- HEX
- RGB
- HSL
Generate a color to see its values.
STEP 2
Color palette
Generated palette colors will appear here.
How the color generator works
Each color is built from three independent random bytes, one per red, green, and blue channel, giving every 24-bit color an equal chance. The bytes come from the browser’s Web Crypto API (crypto.getRandomValues) with rejection sampling, so no insecure fallback such as Math.random() is used. If secure randomness is unavailable, generation stops and reports an error instead of producing a guess.
The tool shows each color as HEX, RGB, and HSL. HEX and RGB describe the same values directly; HSL restates them as hue, saturation, and lightness. Conversions round to whole numbers, so a value converted to HSL and back can differ by a unit or two per channel. Palette generation requests three to six colors and retries when a color repeats, so a palette stays duplicate-free.
Reading the values
HEX packs red, green, and blue into two hexadecimal digits each, for example #4f8cff. RGB lists the same channels as decimal numbers from 0 to 255, for example rgb(79, 140, 255). HSL describes hue in degrees from 0 to 360, then saturation and lightness as percentages, for example hsl(219, 100%, 65%).
Swatch labels are drawn in black or white based on the color’s relative luminance, so the HEX text stays readable against light and dark colors alike. Copy a single format, a single swatch, or all palette HEX values at once.
Color generator FAQ
Are the colors cryptographically secure?
The channels come from the Web Crypto random-byte API with rejection sampling, so every color is uniformly distributed and unpredictable. The tool has not been independently audited, so treat it as a convenience generator rather than a security primitive.
Does the generator save or send anything?
No. Colors are created in your browser and the tool does not send or save your input, results, or settings. Nothing is stored between visits. The site’s hosting provider and the disclosed advertising script may still process ordinary technical request information, as described in the privacy policy.
Can two palette colors match?
The generator retries when it draws a color already in the palette, so the colors in one palette are distinct. Different palettes generated at other times can still contain the same color by chance.
Related color tools
To build harmonies around a color you already have and check WCAG contrast, use the color contrast picker. To compare two to six finished colors side by side, use the color comparison tool.
Last updated: