Black Friday: 50% off every paid plan with code BF50. Ends 5 December.

See prices

Free tool

Random color generator, roll until it clicks.

Press the button for random colours, one or up to twelve at a time, each with its HEX, RGB and HSL code to copy. Pick any colour or a mood, pastel, vivid, dark, light, warm, cool or greys, lock the ones you like and roll the rest until the set works. Copy them as CSS variables or save a PNG strip for your mood board.

Need a custom tool, app or website? Contact us 

Press Space for new colours. Click a code to copy it. Lock a colour to keep it.

Colours are made in your browser.

How it works

Random, with taste.

01 / Moods

Even lightness

Pastel, vivid, dark and the rest are picked in OKLCH, so a pastel set really looks equally soft, not random.

02 / Lock

Keep what works

Lock the colours you like and every roll changes only the others, the quickest way to build a palette.

03 / Codes

HEX, RGB, HSL

Every colour shows its codes for CSS, design tools and code, one click to copy each.

Guide

How to generate random colours, and turn them into a palette.

A random color generator picks colours for you by chance, so you can break out of the same few shades you always reach for. This one gives you 1 to 12 colours per roll, each with its HEX, RGB and HSL code, and lets you narrow the chance to a mood like pastel, vivid or warm. Lock the colours you like and keep rolling the rest, then copy the set as CSS or save it as a picture.

How to use the random color generator

  1. Set How many to the number of colours you want. Pick 1 for a single colour, or 5 for a palette.
  2. Choose a Mood, or leave it on Any colour for a completely open roll.
  3. Press New colors, or press Space on your keyboard.
  4. Click Lock on any colour you want to keep. It stays put while the others change.
  5. Click a code to copy it: the HEX, the rgb() or the hsl() line.
  6. Press Save PNG for a strip of swatches with their hex codes, Copy as CSS for the whole set as custom properties, or Copy link to share the exact set.

Changing the Mood clears every lock and rolls a fresh set, so lock your favourites only after you have picked the mood.

What each mood gives you

Any colour picks red, green and blue each from 0 to 255 with equal chance, so every one of the 16,777,216 hex colours can come up. That is true randomness, which also means a lot of muddy browns and greys. The moods pick in OKLCH instead, a colour space where lightness matches what the eye sees, so a set feels even.

MoodWhat you getGood for
Any colourAnything at all, fully randomGames, art prompts, tests
PastelVery light, soft coloursBaby showers, notes apps, calm backgrounds
VividBright, strongly saturated coloursButtons, charts, posters, sports kits
DarkDeep colours with a little hueDark mode backgrounds, text, headers
LightNear white with a faint tintPage and card backgrounds
WarmReds, oranges and yellowsFood, autumn themes, friendly brands
CoolGreens, teals, blues and violetsTech, health, water and winter themes
GreysNeutral greys, never pure black or whiteUI neutrals, borders, text shades

Building a palette from random colours

Randomness is a good start, not a finished palette. A simple way to get a set that works together:

  1. Roll 5 colours on Vivid until one stands out as your main colour. Lock it.
  2. Switch How many to 5 and keep rolling. Lock one colour that sits well next to the first as an accent.
  3. Add a dark colour for text and a light one for backgrounds. Rolling the Dark and Light moods separately and noting the codes works well for this.
  4. Use the main colour for large areas sparingly, the accent for small things like buttons, and let the neutrals do most of the work.

Each swatch shows its codes in black or white, chosen by how light the colour is, which gives a first hint of which text colour will read on it. For a proper check, test the pair against the WCAG ratios before you use it for text.

Fun ways to use a random colour

  • Drawing challenges. Roll 3 colours and draw something using only those. It forces new choices.
  • Picking a team or game colour. Set How many to the number of players and roll once, so nobody argues.
  • Mood boards. Save PNG gives a clean strip of swatches with the hex code under each one, ready to drop into a board or a slide.
  • Testing designs. Drop random colours into a layout to see how it holds up with colours you did not plan for.

Sharing and saving a set

The page address updates with the hex codes of the colours on screen, so Copy link (or copying the address) shares the exact set, and opening it brings the same colours back. How many and the mood are kept in this browser for your next visit. Copy as CSS gives you a block like this, ready to paste into a stylesheet:

:root { --color-1: #7c52ff; --color-2: #ffb347; }

Rename the variables to what they do, like --brand or --accent, once you know each colour's job.

Making a random colour in code

If you need random colours inside your own project, a random whole number from 0 to 16,777,215 written in base 16 is a random hex colour. In JavaScript: '#' + Math.floor(Math.random() * 0x1000000).toString(16).padStart(6, '0'). The padStart matters: without it, small numbers give a code with fewer than six digits.

Want a palette that follows colour theory instead of chance? Try the color palette generator. To check that a text colour is readable on your new background, use the color contrast checker.

Questions

Good to know.

How do I get a random colour?

Press New colors or Space. Set How many to 1 for a single colour.

Can I make a palette?

Yes. Show 5 colours, lock the ones you like, and keep rolling the rest.

What do the moods do?

They keep colours in a range: pastel is light and soft, vivid is bright and saturated, dark is deep, warm leans red to yellow, cool leans green to blue.

Can I share a set?

Yes. The address bar holds the colours, so copying the page link shares the set.

How do I use them in CSS?

Press Copy as CSS for a set of custom properties, like --color-1: #7c52ff;.

How many colours can the generator pick from?

On Any colour, all 16,777,216 hex colours, since each of red, green and blue can be any of 256 values. The moods pick from a smaller range so the set looks even.

Is the colour really random?

Yes. Each roll uses the browser's secure random number generator, the same kind used for making passwords, so there is no pattern to the results.

Can I get the same colour twice?

It can happen, but on Any colour the chance is tiny. Lock a colour if you want to be sure it stays.

How do I pick a random colour for text so it stays readable?

Roll on the Dark mood for text on light backgrounds, or Light for text on dark ones. Then check the pair with a contrast checker before you use it.

Listed on

Listed on JustMacAppsMotionShine on Mac App IndexMotionShine on ScrollLaunchMotionShine featured on StartupBaseFeatured on FazierFeatured on Twelve ToolsMotionShine - Featured on Smol Launch