Generate random colors instantly. Press Space for a new color. Filter by mood: pastel, dark, warm, cool.
#7C3AED
HEX#7C3AED
RGBrgb(124, 58, 237)
HSLhsl(262, 83%, 58%)
or press Space
Random Palette (5 Colors)
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.
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.