Random Color Generator
Generate random colors with hex, RGB and HSL shown at once - free, no signup.
What this tool does
Generate one or many random colors instantly, each shown as a swatch with its hex, RGB and HSL codes all at once. Turn on Pastel for genuinely softer, lighter colors - generated by constraining saturation and lightness in HSL space, not just picking any random color and hoping it looks pastel.
Generates one or many random colors, each shown as a swatch with hex, RGB and HSL codes simultaneously.
Offers a genuine pastel mode, generated by constraining lightness and saturation rather than just picking any random color.
Uses the browser's cryptographically secure random source for the color draw.
Draws normal-mode colors as three independent, uniform 0-255 values for red, green and blue, so every one of the 16.7 million possible RGB colors is equally reachable.
Constrains pastel mode to a fully random hue (0-360°) with saturation limited to roughly 45-70% and lightness to roughly 75-87%, rather than narrowing hue too.
How to use it
- Choose how many colors you want.
- Turn on Pastel if you want softer, lighter colors.
- Press Generate, and copy the codes you need.
Why use this generator
Designers, developers and students need colours quickly and in several formats, and choosing by hand is slow and biased. Random colours with hex, RGB and HSL save conversions.
Why we built it
We built the random colour generator to show hex, RGB and HSL together for every colour. Convert codes with the colour converter and build a scheme with the palette generator.
Related tools worth a look: the Random Shape Generator.
Who this tool is for
- Designers and developers seeking inspiration
- Teachers running art lessons
- Game developers
When to use it
- Finding a colour for a design or theme.
- Testing contrast and layouts.
- Picking colours for charts or games.
- Getting pastel palettes.
How the pastel mode actually works
Constraining the right dimensions of color, not just picking randomly and hoping.
A genuinely pastel color has moderate saturation and high lightness - it's not simply 'any random color that happens to look soft'. This generator's pastel mode works in HSL space specifically, picking a fully random hue but constraining saturation to a moderate range and lightness to a high range, which reliably produces the soft, muted colors people mean by 'pastel', rather than occasionally producing a bright, saturated color by chance.
| Dimension | Normal mode | Pastel mode |
|---|---|---|
| Hue | Fully random, 0-360° | Fully random, 0-360° - unrestricted, since hue alone doesn't make a color look pastel |
| Saturation | Whatever an RGB draw happens to produce | Constrained to roughly 45-70%, moderate rather than vivid |
| Lightness | Whatever an RGB draw happens to produce | Constrained to roughly 75-87%, consistently light |
What you give it, and what you get back
| Item | Details |
|---|---|
| Mode | Any colour or pastel. |
| Count | How many colours. |
| Output | Swatches with hex, RGB and HSL values. |
Issues you may run into
| What you see | Why it happens | What to do |
|---|---|---|
| Colours do not match each other | Each is random. | Use the palette generator for harmony. |
| Contrast is poor | Random colours ignore accessibility. | Check with the contrast checker. |
| Names not shown | Only codes are given. | Use a colour name lookup. |
Assumptions and limitations
- This generates fully random or pastel-constrained colors; it doesn't generate a coordinated palette from one base color - the color palette generator does that instead.
- Colors are shown as hex/RGB/HSL only; a named color match (like 'CornflowerBlue') isn't included.
Frequently asked questions
How do I generate a random color online for free?
Choose how many colors you want and press Generate - each appears as a swatch with hex, RGB and HSL codes.
How does the pastel mode work?
It constrains saturation to a moderate range and lightness to a high range in HSL color space, which reliably produces soft, muted colors rather than randomly hoping for one.
How random are these colors really?
They come from the browser's cryptographically secure random number generator, the same quality used for security-sensitive purposes.
Can I generate a matching palette instead of one random color?
For a coordinated palette from a base color, use the color palette generator instead - this tool generates independent random colors.
Is my data uploaded anywhere?
No. Generation happens entirely in your browser - nothing is sent to a server.
Are all 16.7 million RGB colors reachable in normal mode?
Yes - red, green and blue are each drawn independently and uniformly from 0-255, so every one of the 16,777,216 possible RGB combinations has an equal chance of appearing.
Does pastel mode restrict the hue too, or just saturation and lightness?
Just saturation and lightness. Hue stays fully random across the full 360° wheel in both modes - pastel mode only narrows saturation to a moderate range and lightness to a high range, since those two dimensions are what make a color read as pastel, not the hue itself.