Random Color Generator

Hex code—
Colour name—
Colours generated—
Format—

How Random Color Generator is calculated: Each colour is three random numbers from 0 to 255 — red, green and blue — written as a hex code #RRGGBB. There are 16,777,216 possible hex colours. The name comes from a small built-in table of common colour ranges, and it is approximate, not exact.

What is a random color generator?

A random color generator makes colours out of thin air: press the button and it shows a hex code such as #A3F2C1, with an approximate colour name beside it. The default is one colour. Set the count to 5 and it makes five colours at once, listed in the box below, each with its own hex code and name.

The problem it solves is the blank page. A designer needs a starting colour, a teacher needs colours for a game, a developer needs a placeholder colour for a mock-up — and staring at a colour wheel for ten minutes is not a good use of that time. A random colour is a starting point, and starting points are what this tool is for.

The hex code is the useful part. A hex code like #A3F2C1 is how colours are written on the web, in design tools, and in code — six characters after a hash, two each for red, green, and blue. Copy the code, paste it into your design tool or your stylesheet, and the colour appears exactly as generated.

The name is approximate, and the page says so. The generator names colours from a small built-in table of common ranges — red, orange, yellow, green, teal, blue, purple, pink, brown, grey, black, and white — so #A3F2C1 comes out as a green, and a dark red-brown comes out as brown. The name is a rough guide, not an exact label: two colours with the same name can look quite different.

Everything runs in your browser. Press the button as often as you like — every press is a fresh, independent set of colours. Nothing is uploaded, nothing is stored, and no account is needed.

How a random color generator works

A colour on a screen is three numbers: red, green, and blue, each from 0 to 255. The generator picks all three at random, so each colour is a random point in a cube of 256 × 256 × 256 possibilities — 16,777,216 colours in total. Every one of them has the same chance of appearing, which is 1 in 16,777,216.

The three numbers are then written as a hex code: each number becomes two hexadecimal characters, and the three pairs follow a hash. A red of 163, a green of 242, and a blue of 193 become #A3F2C1, because 163 is A3 in hexadecimal, 242 is F2, and 193 is C1. The format is always #RRGGBB, six characters, and the page shows it that way.

The name comes from a small table that looks at which channel is strongest. If red is strongest and green is high too, the name is Orange. If green is strongest and blue is high, the name is Teal. If all three channels are close together, the name is Grey; if they are all low, Black; if they are all high, White. The table has twelve names, and every colour lands in one of them.

This page uses the browser's random number generator to pick each channel, so the result is genuinely unpredictable. A color picker does the opposite job — you choose a colour and it shows the hex code — while this tool chooses the colour for you.

One colour or five: what changes

One colour is a starting point. A designer who needs a single accent colour, a developer who needs a placeholder, a teacher who needs one colour for a game — one press, one colour, one hex code to copy. The name beside it tells you roughly what you got, so you can decide at a glance whether to keep it or press again.

Five colours are a palette to react to. A designer looking for inspiration can press the button, look at five random colours, keep the one that works, and press again for the rest. The five colours are independent — they are not chosen to go together — so a set of five is a lucky dip, not a designed palette.

The count also changes what the page shows. With one colour, the hex code and the name are the whole result. With five, the box below lists all five, numbered, each with its hex code and its approximate name, so you can copy the one you want without losing the others.

For a palette where the colours are chosen to work together, a color palette generator is the better tool — it builds sets of colours that harmonise. This generator is the raw material: random colours, one at a time or five at a time, for the moments when any colour will do.

A worked example: three colours, three hex codes

Press the button with the count at 1 and a colour appears, for example #A3F2C1 — a light green, named Green (approx.). The red channel is 163, the green is 242, and the blue is 193, so green is the strongest channel and the name follows it. The chance of that exact hex code appearing was 1 in 16,777,216.

Set the count to 3 and press again, and three colours appear, for example #E74C3C, #2E86C1 and #F1C40F. The first is a red, the second a blue, and the third a yellow — three different corners of the colour cube, in one press. The list shows all three, numbered, with their names, so you can copy any one of them.

Set the count to 5 and the list grows to five colours. Five random colours will usually include a mix of families — a red, a green, a blue, and two others — because the colour cube is large and the picks are independent. Getting five colours from the same family in one press is rare, which is why five random colours make a varied starting set.

Try your own count now. Set it to 5, press the button a few times, and watch the hex codes change. Each press is a fresh set of five, and the chance of the same set appearing twice is 1 in 16,777,216 five times over — effectively never. That is the honest scale of the randomness here.

Who generates random colours, and why

Designers are the main users. A blank canvas needs a first colour, and a random colour breaks the block — it is easier to react to a colour than to invent one. The designer keeps it, adjusts it, or presses again, and the hex code copies straight into the design tool.

Developers use it for placeholders and test data. A mock-up needs a background colour, a chart needs five series colours, and a test needs a colour value that looks real. A random hex code fills the gap without a trip to a colour picker, and the format is already #RRGGBB, ready to paste into code.

Teachers use it for games and lessons. Pick a colour and name it, pick five colours and sort them, or generate a colour and ask the class what it is called. The approximate name on the page gives the class a starting answer, and the discussion about whether it is really green or really teal is the lesson.

A color contrast checker can check whether a generated colour is readable as text on a background — a random colour is a starting point, and the checker says whether it works in practice. A background color changer can preview a generated colour as a page background before you commit to it.

Random color generator vs color picker

A random color generator and a color picker are opposite tools. The generator chooses a colour for you, at random, and shows the hex code. The picker lets you choose a colour yourself, by eye, and shows the hex code of the colour you picked. One is chance, the other is choice.

Use the generator when you do not know what you want: a starting colour, a placeholder, a surprise for a game. Use the picker when you know what you want: the exact blue of a logo, a colour that matches a photograph, a shade you saw on a website. The generator is for the blank page, and the picker is for the precise match.

The two tools agree on the format. Both show the hex code as #RRGGBB, six characters after a hash, and both can be copied into a design tool or a stylesheet. A colour from the generator can be pasted into the picker and adjusted — take the random starting point, then tune it by eye until it is right.

For a set of colours that work together, a color palette generator builds harmonising palettes from a base colour. The random generator gives you the base colour, the palette generator builds the family around it, and the picker fine-tunes any single member.

Common random colour mistakes

The most common mistake is trusting the name too much. The name is approximate — it comes from a small table of twelve colour families, and it describes the strongest channel, not the colour you see. A colour named Green can be a pale mint or a deep forest green, and the hex code is the only exact description. Copy the hex code, not the name.

Second: using a random colour without checking contrast. A light yellow on a white background is unreadable, and a dark blue on a black background is invisible. A random colour is a starting point, not a finished choice — check it against its background before you use it for text. A color contrast checker gives the contrast ratio in seconds.

Third: expecting five random colours to work as a palette. They are independent picks, not a designed set, and they usually clash. Five random colours are five starting points, not a colour scheme. Keep the one you like, discard the rest, and build the palette around it with a palette tool.

Fourth: forgetting that screens differ. The same hex code can look different on two screens, because screens are calibrated differently. A colour that looks right on your phone can look washed out on a laptop. Check the important colours on the device your audience will use, not only on your own screen.

How to use this random color generator

Using this random color generator is simple. Set how many colours you want — 1 is the default, 5 is the most. Press Generate a Colour, and the hex code appears, with the approximate colour name, the count, and the format below it. With more than one colour, the full list appears in the box underneath, numbered, each with its hex code and name.

Copy the hex code, not the name. The hex code is exact — #A3F2C1 is always the same colour — while the name is approximate and covers a wide range of shades. Paste the code into your design tool, your stylesheet, or your slide deck, and the colour appears exactly as generated.

Everything runs in your browser. No account, no form, no data sent anywhere — the colours never leave your device. You can generate as many colours as you like, for as many projects as you like. A random string generator is another random tool in the same spirit, making text instead of colours.

Remember the honest limit: the colour is random. It is a starting point for design, a placeholder for code, and a bit of fun for a game — and it is not a colour scheme, a brand colour, or a finished choice. Take the random colour, check it, tune it, and make it yours.

Frequently Asked Questions

16,777,216. A hex code is three numbers — red, green, and blue — each from 0 to 255, so the total is 256 × 256 × 256 = 16,777,216. Every one of them has the same chance of appearing from this generator, which is 1 in 16,777,216 for any exact code.

No — the name is approximate. It comes from a small built-in table of twelve common colour families, based on which colour channel is strongest. A colour named Green can be a pale mint like #A3F2C1 or a deep forest green. The hex code is the exact description; copy the code, not the name.

Yes — set the count to anything from 1 to 5. The page shows the first colour's hex code and name at the top, and the full list appears in the box below, numbered, each with its hex code and approximate name. The five colours are independent picks, so they are not chosen to go together.

A hex code writes a colour as #RRGGBB — six hexadecimal characters after a hash, two each for red, green, and blue. For example, #A3F2C1 means red 163, green 242, and blue 193. It is the standard way colours are written on the web, in design tools, and in code, and you can paste it straight into a stylesheet.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.