Random Color Generator

A free tool by DeepRit, a Google Ads agency that does PPC and nothing else. We build and run Google Ads accounts so every click is accounted for. Book a free audit call

Free random color generator. Make one or many random colors with HEX, RGB and HSL codes, copy any of them, and see which text color reads best on each.

All HEX codes

Free, no sign-up. Runs in your browser: nothing you type is uploaded or saved.

How to use the random color generator

  1. Choose how many colors you want, from 1 to 100.
  2. Press Generate. Each press creates a new set.
  3. Look at the swatches. Each color is shown as a band with its HEX code, RGB value and HSL value, in readable black or white text depending on the background.
  4. Copy any color with the Copy button on its swatch, or copy every HEX code at once from the box below.

Colors are picked using your browser's secure random number generator, so every one of the 16,777,216 possible colors is equally likely. Nothing is sent anywhere.

How the colors are generated

Screen colors are made from red, green and blue light, each with a value from 0 to 255. That gives 256 × 256 × 256 = 16,777,216 possible colors. The random color generator picks a whole number in that range and splits it into its red, green and blue parts.

It then shows the color in three common formats:

  • HEX: six hexadecimal digits, two each for red, green and blue, such as #3A7BD5. Used in CSS, design tools and brand guidelines.
  • RGB: the three values from 0 to 255, such as rgb(58, 123, 213).
  • HSL: hue (0–360°), saturation and lightness as percentages, such as hsl(215, 65%, 53%). HSL is often easier for people to adjust, because you can change lightness without changing the hue.

The HEX to RGB converter converts any color between these formats.

Readable text on every color

Each swatch shows its label in black or white, chosen by the color's relative luminance (how bright it appears to the eye). Dark colors get white text and light colors get black. This is a quick visual aid; to check whether a pairing meets accessibility guidelines, use the color contrast checker, which calculates the WCAG contrast ratio.

Uses for random colors

  • Design inspiration: break out of your usual choices and discover combinations you wouldn't have picked.
  • Placeholder colors for wireframes, mock-ups and prototypes.
  • Data visualisation tests: quickly fill charts and maps while building them (but choose a deliberate palette for the final version).
  • Generative art and games: random fills, particles and characters.
  • Art and drawing challenges: paint or draw with three random colors.
  • Teaching: showing how HEX, RGB and HSL describe the same color.
  • Party and classroom games: picking a team color or a theme.

From random colors to a palette

Purely random colors often clash. To turn one you like into a usable palette:

  1. Keep the color you like and copy its HEX code.
  2. Make shades and tints of it with the color shades generator, which builds a full scale from light to dark.
  3. Add a neutral (a grey or off-white) and maybe one accent color.
  4. Check contrast for text and buttons with the color contrast checker.
  5. Try it in a gradient with the CSS gradient generator.

If you'd rather start from a photo, the color palette from image tool extracts the main colors, and the image color picker picks any pixel.

A little color theory

Some classic relationships on the color wheel (based on hue in HSL):

  • Complementary: opposite hues, 180° apart. High contrast and energetic.
  • Analogous: neighbouring hues, about 30° apart. Calm and harmonious.
  • Triadic: three hues 120° apart. Balanced and colourful.
  • Monochromatic: one hue in different lightness and saturation. Clean and cohesive.

Take the hue of a random color and add 180° for its complement, or ±30° for analogous colors. Saturation and lightness matter as much as hue: muted colors (lower saturation) feel calmer and more sophisticated; bright ones feel playful.

Colors and brand identity

Colors carry associations, though they vary by culture and context: blue often suggests trust and calm, green growth and nature, red energy and urgency, black luxury and seriousness. For a brand, consistency matters more than the "perfect" color: pick a palette and use it everywhere.

Random color generator ideas for designers

A random color generator is a quick way to get unstuck. Some ways designers use it:

  • Generate eight colors and pick one you'd never usually choose, then build a small palette around it.
  • Use random colors as accents on a neutral design to see what stands out.
  • Test a layout with several random palettes to check that it works regardless of color.
  • Create mood boards: generate a batch, keep two or three that fit a brief, and discard the rest.

Random colors in CSS and code

Copy any HEX code from the random color generator straight into CSS: color: #1F7A8C; or background: #1F7A8C;. To generate random colors in your own code, pick a random number from 0 to 16,777,215 and format it as six hex digits, padding with leading zeros. In JavaScript, use a secure source if fairness matters (for example, in games or prize draws).

Color accessibility

About 1 in 12 men and 1 in 200 women have some form of color vision deficiency, most commonly difficulty telling red from green. When using colors to convey meaning in charts, maps or status labels, don't rely on color alone: add labels, patterns or icons. Check text contrast for every background color, especially mid-tone colors from a random color generator, which may need either black or white text depending on their lightness.

Understanding HEX, RGB and HSL together

The three codes the random color generator shows describe the same color in different ways:

  • HEX packs the red, green and blue values into six hexadecimal digits. #FF0000 is pure red: FF (255) red, 00 green, 00 blue.
  • RGB writes the same three values as ordinary numbers from 0 to 255, which is easier to read and adjust in code.
  • HSL describes the color the way people tend to think about it: the hue (where it sits on the color wheel, from 0 to 360 degrees), the saturation (how vivid it is) and the lightness (how close it is to black or white).

To make a lighter or darker version of a random color, keep its hue and saturation and change the lightness in HSL. To make a muted version, lower the saturation. This is much easier than adjusting the three RGB values by hand.

Random colors for data and charts

Random colors are handy while building a chart, but they're rarely the best final choice. Neighbouring random colors can look too similar, and some combinations are hard to tell apart for people with color vision deficiency. For finished charts, choose a palette with clearly different hues and lightness, check it in grayscale, and label your data directly where possible. The random color generator is a starting point; deliberate choices make the final design.

Saving your favourite colors

The random color generator doesn't keep a history, so copy any colors you like before pressing Generate again. A simple text file or design tool library with each HEX code and a short name works well.

Random colors for teaching

Teachers use random colors to show how HEX, RGB and HSL relate. Generate a color, read its RGB values, and convert them to hexadecimal by hand: 31 is 1F, 122 is 7A and 140 is 8C, giving #1F7A8C. Then check the answer against the swatch.

A worked example

A designer is creating placeholder cards for a website mock-up and wants eight distinct colors. She sets "How many colors" to 8 and presses Generate. One of the swatches is a deep teal, #1F7A8C, rgb(31, 122, 140), hsl(190, 64%, 33%), shown with white text because it's dark.

She likes the teal for the client's brand, so she copies it into the color shades generator to build a full scale, and checks that white text on it passes the contrast checker for buttons. For the mock-up, she copies all eight HEX codes from the box and pastes them into her design file.

Need more customers from Google?

This tool is free and runs in your browser. If your business also needs more leads or sales, Google Ads is where people search with their wallet out. That is the whole job of DeepRit: a PPC-only agency that sets up and runs Google Ads accounts so every click is accounted for. You keep full ownership of your account, get a written report every week, and can stop at any time. See our pricing or ask for a free audit.

Frequently asked questions

How does the random color generator work?

It picks a random number between 0 and 16,777,215 using your browser's secure random generator, then splits it into red, green and blue values and shows the HEX, RGB and HSL codes.

How many colors can I generate at once?

From 1 to 100 per press.

What is a HEX color code?

A six-digit hexadecimal code for a color, such as #3A7BD5, with two digits each for red, green and blue.

Can I copy all the colors at once?

Yes. Every HEX code is listed in the box below the swatches, ready to copy.

How do I turn a random color into a palette?

Generate shades of it with the color shades generator, add a neutral, and check contrast for text.

Is the random color generator free?

Yes. It's free, needs no sign-up, and works in your browser.

Free PPC audit

See where your ad budget leaks.

We look at your Google Ads account before the call, then walk you through what we'd fix first, in dollars. No obligation, no hard sell.

Book a free audit call 30-minute call · Free · The audit is yours to keep