RandomWiz

Random Color Generator

Use this random color generator to get a color or a full palette with HEX, RGB, HSL and CMYK codes, its name and a contrast check. Press the space bar for new colors.

Tap the code to copy

Tints and shades

Recent colors

Color codes

Text contrast (WCAG)

How to use the random color generator

  1. Press New color or the space bar for a random color with its name and codes.
  2. Choose a mood (pastel, vivid, dark, muted, neon, earthy) or a hue family to steer the results.
  3. Switch to Palette for matching colors. Lock the ones you love and generate again.
  4. Check the preview and the vision simulation, then export as CSS, Tailwind, JSON or PNG.

More than a random HEX code

Names and codes

Every color comes with its closest name and its HEX, RGB, HSL and CMYK values, ready to copy.

Accessible by design

See the WCAG contrast ratio for white and black text, and how a palette looks with three types of color blindness.

Real preview

Your palette is applied to a sample web page, so you can judge it on buttons, headings and cards, not just swatches.

Harmonies and moods

Analogous, complementary, triadic, square and monochrome palettes in any mood, from soft pastels to neon.

Try these free tools next

What is a random color generator?

A random color generator picks a color by chance from the 16,777,216 colors a screen can show. Use it when you want a fresh idea, a surprise for a project or a way to break out of your usual choices. (In the UK and elsewhere, you may know this as a random colour generator or colour picker. It's the same tool.)

Each result comes with its closest color name, its HEX, RGB, HSL and CMYK codes, and a contrast check, so you can use it straight away.

Random colors by mood and hue

Fully random colors can look muddy. Choose a mood or a color family to get results that suit your project. Each link opens the generator with that setting.

Random color palette generator

Switch to Palette for a set of colors that work together. Choose how many colors you want and a harmony such as analogous, complementary or triadic. Lock the shades you love, then generate again to replace only the rest.

When you are happy, check the palette on a sample web page, test it for color blindness, and export it as CSS, Tailwind, JSON or PNG.

HEX, RGB, HSL and CMYK codes explained

CodeWhat it meansExampleBest for
HEXRed, green and blue written as a six-character code#4F46E5Websites and design tools
RGBRed, green and blue, each from 0 to 255rgb(79, 70, 229)Screens and code
HSLHue, saturation and lightnesshsl(243, 75%, 59%)Adjusting a color by eye
CMYKCyan, magenta, yellow and black inkcmyk(66, 69, 0, 10)Print

Random color ideas and challenges

A random color picker isn't only for designers. Try it for:

  • Art challenges: draw or paint something using only three random colors.
  • Characters: choose hair, eye and outfit colors for an original character.
  • Crafts: pick a yarn, bead or nail polish color when you can't decide.
  • Outfits: dress around a random color of the day.
  • Games and kids: spot something of that color in the room as fast as you can.

Random color in JavaScript, Python and CSS

Developers often search for a one-line random HEX color. These work, although simple code cannot control mood or contrast:

LanguageCode
JavaScript'#' + Math.floor(Math.random() * 0x1000000).toString(16).padStart(6, '0')
Pythonf"#{random.randrange(0x1000000):06x}"

Frequently asked questions

How do I generate a random color?

Press New color or the space bar. Pick a mood such as pastel or vivid, or a hue family such as blue, to narrow the result. Tap any code to copy it.

How do I keep a color I like in a palette?

Tap the lock on that swatch. Locked colors stay when you generate again, and the harmony is built around the first locked color.

What do AA and AAA mean?

They are WCAG accessibility levels for text contrast. AA needs a ratio of at least 4.5:1 for normal text, and AAA needs 7:1. The generator shows whether white or black text passes on each color.

Can I check a palette for color blindness?

Yes. Choose protanopia, deuteranopia or tritanopia under Vision to see how the palette and preview look to people with those types of color blindness.

How do I use the palette in my project?

Copy it as CSS variables, a Tailwind colors object or JSON, download it as a PNG image, or share a link to the exact palette.

How many colors are there to choose from?

Standard screens can show 16,777,216 colors, which is 256 levels each of red, green and blue. With Any mood, the generator favours colors that are easy to see, rather than near-black or near-white.

What is a HEX color code?

It is a six-character code that describes a color on screen, for example #FF0000 for pure red. The pairs of characters set the red, green and blue levels.

Can I get the name of a random color?

Yes. Each color shows the closest named color, so a code like #4F46E5 is easier to talk about and remember.

Can I get only pastel colors?

Yes. Set Mood to Pastel. You can do the same for neon, vivid, dark, muted and earthy colors.

Is it a color wheel?

It generates colors with a button rather than a spinning wheel. To spin a wheel of color names, add them to the Random Name Picker.

Are the colors accessible?

Each color shows its WCAG contrast score against white and black text, and palettes can be tested for three types of color blindness.

Looking for random images instead?

Try the Random Image Generator for photos in any size, or browse all tools.