Random Color Generator

Tap the button for a random colour: a fresh hex and RGB each time, drawn evenly from all 16.7 million on-screen colours, in your browser.

Color Tools● Free No upload Instant

Loading Random Color Generator…

Your browser is preparing the tool. It runs 100% locally.

Quick answer

Press the button and the tool picks a random colour, showing its hex and RGB. Each of the red, green and blue channels is chosen independently from 0 to 255, so any of the 16,777,216 possible colours is equally likely. It uses the browser's Math.random, which suits design inspiration but not anything security-related. Keep tapping for a new colour; it all runs in your browser.

What the Random Color Generator does

This tool produces a single random colour each time you ask for one, displayed as a swatch with its hex code and RGB values ready to copy. Tap again and you get a completely fresh, unrelated colour.

Use it to break a creative block, find an unexpected starting colour, fill a placeholder or browse the colour space when you have no particular shade in mind.

How it works

A colour on screen is three numbers (red, green and blue), each from 0 to 255. The tool generates each of those three independently by taking a random fraction and scaling it to the 0-to-255 range, then assembles the result into a hex code.

Because all three channels are random and independent, every possible combination is equally likely, so the colour can land anywhere in the full range: pale, vivid, dark or muted. The randomness comes from the browser's built-in Math.random, which is fast and even but is a pseudo-random generator, not a secure one.

Generation algorithm

  1. Pick three random channels. Generate a random value for red, green and blue, each a whole number from 0 to 255.
  2. Assemble the colour. Combine the three channels into a single colour.
  3. Convert to hex. Turn the red, green and blue values into a hex code for display and copying.
  4. Repeat on demand. Each tap draws a brand-new, independent colour with no memory of the last one.

How a random colour is built

red = floor( random × 256 ) green = floor( random × 256 ) blue = floor( random × 256 ) then combine red, green and blue into a hex code
Worked example
channels 37, 99, 235 → #2563EB

Each channel is an independent whole number from 0 to 255, giving 256 × 256 × 256 = 16,777,216 possible colours, each equally likely.

Standards & references

  • Math.random (pseudo-random): The browser's standard random function. It is fast and statistically even, but predictable in principle. That is fine for visuals, not for secrets, keys or anything that must be unguessable.
  • 24-bit RGB colour: Eight bits each for red, green and blue gives 256 levels per channel and 16,777,216 colours in total, the standard true-colour range this tool draws from.
  • sRGB: The standard colour space for screens and the web, so the hex codes display consistently across browsers and devices.

Accuracy and limits

The draw is statistically uniform: over many taps, colours are spread evenly across the whole range with no bias toward any region. It is not cryptographically secure: Math.random is a pseudo-random generator, so never use these colours where unpredictability matters, such as tokens or passwords.

There are no constraints on the result. A random colour can come out very pale, almost black, or an awkward muddy shade, and two consecutive colours may clash. The tool does not filter for pleasantness or usefulness.

It generates one colour at a time with no memory. There is no seed, no way to reproduce a particular sequence, and no guarantee a colour will not repeat eventually across many draws, though with 16.7 million options repeats are rare.

A random colour says nothing about contrast or readability. If you plan to put text on it, or pair it with another colour, check the combination in a contrast checker rather than assuming it works.

Where people use it

Beating a creative block

Get an unexpected starting colour when you have no idea where to begin.

Placeholder colours

Drop a quick random colour into a mockup or test layout.

Exploring the colour space

Tap through colours to discover shades you would not have picked.

Games and prototypes

Assign random colours to items, tags or chart series.

When it fits, and when it doesn't

Good for

  • Design inspiration and idea-starting
  • Placeholder or test colours
  • Random swatches for prototypes
  • Browsing the colour space

Not the best choice for

  • Anything security-related (tokens, keys)
  • Guaranteed readable or accessible colours
  • A coherent brand or UI palette
  • A reproducible, seeded sequence

For secure randomness use a tool built on a cryptographic generator. For a colour scheme that works together, use a palette generator. To be sure text is readable on a colour, check it in a contrast checker.

Frequently asked questions

How random is the colour?
Each of the three channels is drawn independently and evenly, so any of the 16,777,216 colours is equally likely. The spread is statistically uniform over many taps.
Is this random enough for passwords or tokens?
No. It uses Math.random, a pseudo-random generator that is predictable in principle. For anything security-related, use a tool built on a cryptographic random source.
How many colours can it generate?
Any of 16,777,216: 256 levels each of red, green and blue (256 times 256 times 256). Practically unlimited for everyday use.
Can I get the same colour twice?
It is possible but unlikely, since each draw is independent across 16.7 million options. There is no seed or history, so you cannot deliberately reproduce a past colour.
Why did it give me an ugly or washed-out colour?
Because every colour is equally likely and nothing is filtered. Pale, dark and muddy colours come up just as often as vivid ones. Tap again for a different one.
Can I copy the colour?
Yes. The hex and RGB values are shown and can be copied straight into your CSS or design tool.
Does it avoid colours that are hard to read?
No. A random colour has no contrast guarantee. If you will place text on it, check the pair in a contrast checker against the WCAG ratios first.
Can I generate a whole palette at once?
This tool gives one colour per tap. For a coordinated set of colours, a palette generator builds schemes (analogous, complementary, and so on) that work together.
Can I restrict it to a certain hue or brightness?
Not here. The draw is unconstrained across the full range. For colours within a theme, pick a base and use a shades or palette tool instead.
What format is the output?
A hex code (for example #2563EB) plus the RGB values. Both are standard and work anywhere CSS colours are accepted.
Is anything sent to a server?
No. The colour is generated in your browser; nothing is uploaded or logged.
Why use a random colour at all?
It is a fast way to spark ideas, escape your usual palette, or fill a placeholder. Many designers use a random draw as a jumping-off point, then refine it into a usable colour.

References

Draws each channel from the browser's Math.random (a pseudo-random generator), so it is great for inspiration but not cryptographically random; every colour in the full 16,777,216 range is equally likely.

PopularHot

Color Picker

Pick a colour and read it as HEX, RGB, HSL and CMYK.

ColorOpen
Popular

HEX to RGB Converter

A hex colour split into its red, green and blue numbers.

ColorOpen
Trending

Color Palette Generator

Analogous, complementary, triadic or monochrome sets from one colour.

ColorOpen
Trending

Gradient Generator

Two colours and an angle become copy-ready CSS.

ColorOpen
Editor's Pick

Contrast Checker

Pass or fail for text and background at each WCAG level.

ColorOpen

RGB to HEX Converter

Red, green and blue values packed into a #RRGGBB code.

ColorOpen

Back to the Random Color Generator

Every conversion happens in your browser. It's free, with no account.