Random Color Palette Generator

Generate a random, harmonious palette of 2 to 10 colours with one click and copy any hex code instantly — runs 100% in your browser with no upload.

Click a swatch to copy its hex. Lock a color and it stays put when you generate again — press the space bar for a new palette.

Adjust the whole palette

Preview

Evening market

Two lines of real body text, on the palette itself, so the contrast below is one you can trust.

Get started

Body text on the background: 4.04:1 — AA (large text only)

:root {
  --color-1: #18a021;
  --color-2: #1ec878;
  --color-3: #33e1e1;
  --color-4: #1860a0;
  --color-5: #1e29c8;
}

🔒 Palettes are generated in your browser — nothing is uploaded.

What this random palette generator does

Press New palette — or the space bar — and this tool builds a fresh set of colors that look good together. You choose how many, from 2 to 10 (five by default), and which harmony they follow. Instead of picking colors at random and hoping they match, it starts from one base hue and derives the rest, so the result is a cohesive palette you can use for a website, slide deck, brand board, illustration, or UI mockup. Each swatch shows its exact hex code, and a single click copies that value to your clipboard so you can paste it straight into CSS, Figma, or any design tool. Use Copy all to grab every hex at once as a comma-separated list, and Copy link to share the palette itself — the URL carries the colors, the locks, the harmony, the base color, all four adjustments, the vision simulation and the export format, so the link opens on exactly what you were looking at.

Seven harmonies, or a base color of your own

Choose analogous, monochromatic, complementary, split-complementary, triad, tetrad or free-style, which rolls a random hue for every swatch after the first. Leave the base color blank and a fresh hue is rolled each time; type a hex such as #3366ff — or use the color picker beside the field — and the palette is built around that color, kept byte for byte rather than quietly rounded through a trip into HSL. Monochromatic holds the single hue and builds a ladder of shades whose step is whatever fits the room on both sides, kept between lightness 6 and 94 so the shades stay distinct instead of piling up on pure white. Asking for one more color hands you one more color: the swatches already on screen are held and only the new ones are rolled. A size outside 2–10 is reported, never silently clamped.

Locks, and the space bar

Every swatch has a lock. A locked color survives every regenerate, and when no base color is set the first locked swatch becomes the color the rest of the palette re-harmonises around — so you can keep the one you like and roll the others until they fit it. The space bar generates a new palette, except while a text field, a select or a button has focus, where it already means something else.

Adjust the whole palette, then check it

Four sliders move every swatch at once: hue (±180°), saturation and brightness (±100 points, applied in HSL), and temperature (±100 — a straight red-up, blue-down trade in sRGB that moves each of those two channels by up to 50 of their 255 steps). Back at zero you get exactly the color that was there, not a value that has been through HSL and back. Turn on Color details and each swatch names its nearest CSS color keyword and prints its rgb() and hsl() values with its contrast ratio on white and on black; the same line is the swatch's tooltip. Color vision repaints the palette the way protanopia, deuteranopia, tritanopia or achromatopsia sees it — only what is painted changes, so the hex codes, the copies and the exports stay the colors you generated. Below that the palette is shown as a small design rather than bare squares: the lightest color becomes the page, the lightest of the rest the card, the darkest the body text and the most saturated of the middle colors the button. The WCAG contrast of that text on that background is measured and printed as a ratio and a level — AAA at 7:1, AA at 4.5:1, AA for large text at 3:1, or below AA — with nothing substituted to make the preview look better than the palette really is.

Nine ways to take it with you

Export as CSS custom properties (--color-1, --color-2…), SCSS variables, a Tailwind config block, JSON, an SVG, a GIMP .gpl palette, plain text, a PNG image, or an Adobe Swatch Exchange .ase file. The seven text formats are shown on the page and can be copied or downloaded as they stand; the PNG and the .ase are binary, so those two come down through Download. Both picture formats draw one 200×240 px block per color with its hex label centred near the bottom, in whichever of white or black reads better on that block.

How the colors are chosen

With no base color a random base hue is picked, then — in the default analogous scheme — each swatch is placed 28° apart around it so neighbouring colors stay related rather than clashing. Saturation is held in a vivid-but-not-harsh range of 62–85% and lightness cycles between 36, 45 and 54 to add depth, keeping the palette balanced. Pinned to a base color that spread is rolled between 18° and 39° instead, because anchoring the same 28° on the same colour would hand you back the hues you already had. Every color is converted to a standard six-digit hex code. The generator is deterministic given its random seed, so the same seed always yields the same palette — that is what makes its logic testable — while a new click reseeds it for a brand-new combination. Nothing about the palette depends on a server; the math runs entirely on your device.

Frequently asked questions

What makes the generated palettes harmonious instead of random noise?

The tool does not pick five unrelated colors. It chooses one random base hue and derives the others as an analogous set — evenly spaced around that hue with matching saturation and small lightness changes — so the colors naturally belong together.

How do I copy a color, and can I copy the whole palette?

Click any swatch to copy its hex code to your clipboard, or use the Copy all button to copy every hex at once as a comma-separated list you can paste into your code or design file.

Is anything uploaded when I generate a palette?

No. Every palette is generated locally with JavaScript in your browser. Nothing you generate or copy is sent to, stored on, or logged by any server.

How do I keep one color and change the rest?

Press the lock under a swatch. A locked color survives every regenerate, and if you have not set a base color the first locked swatch becomes the color the rest of the palette is rebuilt around, so the new colors harmonise with the one you kept. The space bar generates again without reaching for the button.

Can I build a palette around a color I already have?

Yes. Type a hex like #3366ff into Base color, or pick it with the color swatch beside the field. That exact color is kept in the palette byte for byte, and the others are placed relative to it by the harmony you chose. Clear the field, or press Random base, to go back to a random hue every time.

Which color harmonies can I choose?

Seven: analogous, monochromatic, complementary, split-complementary, triad, tetrad, and free-style, which rolls a random hue for every swatch after the first. Complementary, split-complementary, triad and tetrad repeat their hue offsets from the base — 180°, 150°/210°, 120°/240°, and 90°/180°/270° — as far as the palette runs.

How many colors can one palette have?

Between 2 and 10, and 5 by default. Ask for more and the swatches already on screen are kept while only the new ones are rolled, so growing a palette does not throw away the one you were building. Type a number outside the range and the tool tells you the limit instead of quietly clamping it.

What formats can I export the palette to?

Nine: CSS custom properties, SCSS variables, a Tailwind config block, JSON, SVG, a GIMP .gpl palette, plain text, a PNG image and an Adobe Swatch Exchange .ase file. The seven text formats are previewed on the page with a copy button; the PNG and the .ase are binary files, so those two are download only.

Does it tell me whether the palette passes WCAG contrast?

It measures it and shows the real number. Under the swatches the palette is laid out as a small card — background, body text and a button taken from the palette's own colors — and the contrast of that text on that background is printed as a ratio with its level: AAA at 7:1, AA at 4.5:1, AA for large text at 3:1, or below AA. With Color details on, each swatch also reports its own contrast on white and on black.

Can I see how the palette looks to a color-blind viewer?

Yes — protanopia, deuteranopia, tritanopia and achromatopsia. The simulation changes only what is painted on screen: the hex codes, the copy buttons and every export still give you the colors you generated.

Can I share or bookmark a palette?

Press Copy link. The whole state travels in the URL — the colors, which swatches are locked, the harmony, the base color, the four adjustment sliders, the vision simulation and the export format — so whoever opens the link sees your palette exactly, and a bookmark brings it back.