Home / Design tools / Random hex color

Random Hex Color Generator

Generate a list of random hex color codes. Choose how many, the letter case, the short or long form, and whether to add transparency.

or press the space bar

Colors

List

Random hex codes in bulk

Set how many codes you want, from 1 to 1000, and press Generate. The codes are listed in a box that you can copy with one click, and each one is also shown as a color swatch. Click a swatch to copy its code on its own.

What a hex color is

A hex color is a hash sign followed by six hexadecimal digits. The digits 0 to 9 and the letters A to F stand for the values 0 to 15. The first pair is the amount of red, the second is green and the third is blue, each from 00 (none) to FF (full, which is 255). So #FF0000 is pure red, #00FF00 is pure green and #FFFFFF is white.

Options

  • Format: choose the full form (#RRGGBB), the short form (#RGB) or the form with transparency (#RRGGBBAA).
  • Letter case: upper case (#3A7BD5) or lower case (#3a7bd5). CSS accepts both.
  • Add the hash: turn it off if you need the bare digits, as some tools and APIs want.
  • Style and hue: narrow the colors to pastels, dark colors or one color family.

Short hex codes

When each pair of digits is a repeated digit, as in #FFAA00, the code can be shortened to #FA0. A short code has only 4,096 possible colors, since each channel has 16 levels. When you choose the short format, every code in the list is one that can be written this way.

Hex with transparency

An eight digit code adds two more digits for opacity. 00 is fully transparent and FF is fully solid, so #FF000080 is red at about half opacity. Modern browsers read this form in CSS. The swatches are drawn on a checked background so that you can see the transparency.

What it is good for

  • Test data and placeholders for user interfaces and charts.
  • Game and art projects that need many different colors.
  • Finding a color to start a design from.

For one color with more information, use the random color generator. For the RGB form, see the random RGB color generator, and for colors that look good together, the random palette generator.

Frequently asked questions

How do I generate a random hex color?

Press Generate. Each code is made from three random values for red, green and blue and written in hexadecimal.

How many hex colors are there?

16,777,216 in the full form. The short three digit form has 4,096.

Can I generate hex codes without the hash sign?

Yes. Turn off Add the hash and the codes are listed as bare digits.

What is an 8 digit hex code?

A hex color with two extra digits for opacity, from 00 (transparent) to FF (solid).