Random Color Generator

Generate random colours in one click, or press the Space bar. Create a single random colour or a palette of up to 50, in styles from truly random to vivid, pastel, dark, light, warm, cool, grey or harmonious (evenly spread hues that always work together). Lock the colours you like while you shuffle the rest, go back to earlier palettes, and copy or export the codes as HEX, RGB or HSL.

  • 100% free
  • No sign-up
  • Private & local
  • Works on mobile

Tip: press Space to generate. Click 🔓 to lock a colour and keep it, and click a code to copy it.

Private by design: every calculation runs locally in your browser. Nothing you type is sent to a server or stored by us.

What Is a Random Colour Generator?

A random colour generator picks colours for you at random. It's a quick way to beat creative block, discover combinations you wouldn't have thought of, or produce test data. Designers use it to explore palettes for logos, websites and illustrations. Developers use it for placeholder backgrounds, chart series, avatars and test fixtures. Artists, teachers, game makers and crafters use it for challenges, prompts and generative art.

Completely random RGB colours are often muddy or clash, so this tool offers styles that constrain the randomness to produce attractive results: vivid, pastel, dark, light, warm, cool, greys, and a harmonious mode that spreads hues using the golden angle, so any number of colours look good together.

How to Use It

  1. Choose how many colours you want, from 1 to 50.
  2. Pick a style for the kind of colours you need.
  3. Click Generate or press Space as many times as you like.
  4. Lock the colours you love with the padlock icon. They stay put while the others change.
  5. Click a colour code to copy it, restore a previous palette from the history, or export the whole palette as HEX codes, CSS variables, JSON or a PNG image.

Colour Styles Explained

StyleHow it's generatedGood for
Completely randomRandom red, green and blue from 0–255Test data, surprises, generative art
HarmoniousHues spaced by the golden angle (137.5°) in OKLCH, balanced lightnessPalettes, chart colours, UI themes
VividHigh saturation, mid lightnessBold brands, games, kids' designs
PastelHigh lightness, soft saturationBaby, wedding, wellness, spring designs
DarkLow lightnessDark mode, luxury, moody designs
LightVery high lightnessBackgrounds, cards, subtle sections
Warm / CoolRed–orange–yellow or green–blue–purple huesSetting a mood
GreysNear-neutral with a slight warm or cool tintUI neutrals, typography

Why the Golden Angle Makes Better Palettes

If you pick hues completely at random, two will often land close together and others will leave big gaps. The golden angle, about 137.5°, is the angle that spreads points around a circle as evenly as possible, however many you add. It's the same pattern sunflowers use to pack their seeds. Stepping the hue by 137.5° for each new colour gives maximum variety with no near-duplicates, which is why the harmonious mode is ideal for chart series and category colours. Generating in OKLCH also keeps the perceived brightness balanced, so no colour shouts louder than the others.

How Many Random Colours Are Possible?

Standard 24-bit colour has 256 levels each of red, green and blue, which gives 16,777,216 possible colours. The chance of generating any specific HEX code in "completely random" mode is one in 16.7 million, so it's very unlikely you'll see the same colour twice.

Creative Ideas

  • Colour challenge: generate three colours and design a poster, outfit or illustration using only those.
  • Brand exploration: lock your main brand colour and shuffle the others to find accents.
  • Data visualisation: generate 6–10 harmonious colours for chart series.
  • Placeholder avatars: use random light or pastel backgrounds with dark initials.
  • Teaching: ask students to identify the HEX, RGB or HSL values or name the colour.

Features

  • 1–50 coloursSingle colours or big palettes.
  • 9 stylesFrom truly random to harmonious.
  • Lock coloursKeep favourites while shuffling.
  • Space barInstant regeneration.
  • HistoryRestore the last few palettes.
  • ExportHEX, RGB, HSL, CSS, JSON and PNG.

From Random Colours to a Finished Palette

A random palette is a starting point, not the finished product. Once you find colours you like, pick one as your main colour and lock it. Then generate tints and shades for backgrounds and text with the Tint & Shade Generator, check that your text and background pairs pass WCAG contrast, and save the final set as CSS variables with the CSS Variable Formatter. That workflow turns a lucky shuffle into a production-ready design system in a few minutes.

Frequently Asked Questions

Are the colours truly random?

They use your browser's random number generator, which is more than random enough for design. Styles limit the ranges to keep results attractive.

How do I generate a random HEX colour in JavaScript?

'#' + Math.floor(Math.random()*16777216).toString(16).padStart(6,'0').

Can I keep a colour I like?

Yes. Click the padlock on that colour, and it stays when you regenerate.

What's the best style for a website palette?

Harmonious, then refine with the Tint & Shade Generator and check text with the contrast checker.

Is there a limit?

No. Generate as many times as you like; everything runs in your browser.