Random Color Generator

Generate random colors instantly. Press Space for a new color. Filter by mood: pastel, dark, warm, cool.

#7C3AED
HEX #7C3AED
RGB rgb(124, 58, 237)
HSL hsl(262, 83%, 58%)
or press Space
Random Palette (5 Colors)
Who this tool is for:

Best for: Breaking a blank-page block by generating an unexpected starting colour, and producing random hex values to test how a component renders

Limitations: Generates colours without checking contrast, so anything used for text still needs an accessibility check afterwards

Best suited for: Designers stuck at the start of a palette who need a prompt rather than a decision

How to Use the Random Color Generator

Click Generate Random Color or press the Space bar to generate a new random color. The large swatch shows the color with its HEX code prominently displayed. Use the Copy buttons to grab the HEX, RGB, or HSL value in any format.

Use the filter buttons to control the type of random color generated. Any generates fully unconstrained random colors. Light generates colors with high lightness values. Dark generates colors with low lightness. Saturated produces vivid, pure colors. Pastel generates soft, light colors with reduced saturation. Warm generates colors in the red, orange, and yellow range. Cool generates colors in the blue and teal range.

The Random Palette section generates 5 colors at once. Click any swatch in the palette to copy its HEX code. Use the New Palette button to regenerate all 5 at once.

Common uses include design inspiration when starting a new project, testing UI components with different color inputs, generating placeholder colors for mockups, and creative exploration when you want something unexpected to start from.

Advertisement

Frequently Asked Questions

CSS itself cannot generate random values, but JavaScript can. Use Math.random() to generate a random HEX. For pastel or dark colors, generate random HSL values with controlled saturation and lightness ranges instead of fully random RGB.
Generate a random integer between 0 and 16,777,215, convert it to hexadecimal, and pad to 6 characters. In JavaScript: '#' + Math.floor(Math.random()*16777215).toString(16).padStart(6,'0'). This is what the Any filter uses.
Random color generators are used for design inspiration, testing UI components with varied colors, generating placeholder palettes, quickly exploring color options, and creating generative art. The filter options produce random colors within a specific mood or style.
Generate random HSL values with high lightness (75-90%) and low to medium saturation (20-40%). This keeps all generated colors in the pastel range regardless of hue. Use the Pastel filter in this tool for instant pastel colors.
Yes. Use the Palette Generator tool to create harmonious random palettes (complementary, analogous, triadic). For maximum harmony, start from a single base hue and generate variations from it rather than using fully random independent colors.
Related Tools

Why Generate Random Colours

Designers use random generation to break out of habitual palettes, since most people reach for the same narrow range unprompted. Developers use it for placeholder and test data, assigning distinguishable colours to chart series or user avatars without hand picking each one.

One practical caution: a randomly generated colour carries no guarantee of legibility. If you intend to place text on it, check the pair against the WCAG contrast requirement before committing.

Get fresh reads straight to your inbox

Get notified when we publish new articles. Unsubscribe anytime.