Images

What is Hex color code?

Also called hex code, hex color or hex colour.

A hex color code is a six-character value such as #1A73E8 that describes a color by its red, green and blue amounts in hexadecimal.

How it works

Screens mix red, green and blue light to make every color. Each channel runs from 0 to 255, and a hex code writes those three numbers in base 16, two characters each. The first pair is red, the second green and the third blue, so #RRGGBB.

Hexadecimal uses the digits 0–9 and letters A–F, so FF is 255 and 00 is zero. Codes where the pairs repeat can be shortened: #FFFFFF, white, can be written #FFF.

Hex codes are the standard way to specify colors in web design, CSS and most design software, which is why brand guidelines usually list them alongside print values. A palette extracted from a photo or logo is simply the most representative pixel colors converted into hex.

A practical example

#FF0000 is pure red: full red, no green, no blue. #808080 is a mid grey because all three channels are equal and halfway up the scale.

What to watch out for

The same hex code can look slightly different on different screens and much different in print, which uses CMYK inks. Check brand colors on a printed proof before a large print run.

Tools you can use

Go a little deeper

Common questions

How do I find the hex code of a color in an image?

Use a color picker or palette extractor. It reads the pixel values in the image and reports them as hex codes you can paste into a design tool or stylesheet.

What does an eight-digit hex code mean?

The last two digits are alpha, the opacity. #1A73E880 is the same blue at about 50 percent opacity.

Are hex and RGB the same?

Yes, they are two ways of writing the same values. #1A73E8 is rgb(26, 115, 232): each pair of hex digits converts to a number from 0 to 255.

Related terms

Browse the complete file format glossary →