Random Color Generator

Generate random colors as hex codes, RGB, HSL or CMYK, pick pastel, bright, dark or neon shades, or build a matching palette from one random hue.

What you can do here

How to use the random color generator

Pick a style and a hue, choose how many colors and press Generate. Each swatch shows its HEX and RGB codes, the nearest CSS color name and the contrast ratio with white or black text. Click a swatch to copy it in the format chosen under Copy format, or copy and download the whole set as text, CSS variables, JSON or CSV. Links such as ?mode=pastel, ?mode=neon or ?mode=blue open the generator ready to go.

Random hex color codes, RGB, HSL and CMYK

Every color is available as a 6-digit hex code (#4F46E5), an RGB triple, HSL values and an approximate CMYK mix for print. HEX and RGB are what CSS, Figma, Canva and most design tools expect; HSL is handy when you want to tweak lightness or saturation by hand. The CSS variables output drops straight into a stylesheet:

:root {
  --color-1: #F2A7C3;
  --color-2: #A7D8F2;
  --color-3: #C9F2A7;
}

Pastel, bright, dark and neon colors

StyleWhat you getGood for
PastelSoft, light, low-to-medium saturationBaby showers, soft UI backgrounds, stationery
Bright / vividFully saturated mid-lightness colorsCharts, buttons, playful branding
DarkDeep shadesDark-mode themes, text colors
NeonMaximum saturationPosters, gaming, highlights
Earth tonesMuted browns, olives, terracottasNatural, rustic designs
Named CSS colorsAll 148 named colors, like rebeccapurpleQuick CSS, games, learning color names

Random color palettes

Switch Colors from independent colors to a palette and every color is built from one random base hue: analogous neighbours 25 degrees apart, a complementary pair from opposite sides of the color wheel, a triadic set 120 degrees apart, or a monochromatic ramp of one hue from dark to light. Combine it with a style, for example pastel triadic, for a coordinated scheme in one click.

Ideas for random colors

Designers use random colors to break out of their usual palette, artists use them for color-challenge prompts, teachers use named colors for games, and developers use them for placeholder avatars, chart series and test data. Check the contrast figure before using a color behind text: 4.5:1 or higher is the WCAG AA target for normal text.

Frequently asked questions

How do I get a random hex color code?

Press Generate with Copy format set to HEX. Each swatch shows a 6-digit hex code such as #4F46E5; click a swatch to copy it, or copy the whole list.

Can I generate random pastel or neon colors?

Yes. Set Color style to Pastel, Bright, Dark, Light, Neon, Earth tones or Grayscale, and optionally limit the hue to reds, blues, greens and so on.

Can it make a color palette that goes together?

Yes. Set Colors to an analogous, complementary, triadic or monochromatic palette. All colors are derived from one random base hue so they work together.

What does the contrast number mean?

It is the WCAG contrast ratio between the color and white or black text, whichever reads better. Aim for 4.5:1 or more for body text and 3:1 for large headings.

Can I export the colors?

Yes. Copy them as HEX, RGB, HSL or CMYK, as CSS custom properties or JSON, or download a .txt or .csv file with every format and the nearest color name.

Related tools

Random Emoji GeneratorRandom Number GeneratorRandom Word GeneratorRandom String GeneratorRandom Object Generator