Gray Color

HEX #808080 · rgb(128, 128, 128) · hsl(0, 0%, 50%)

Gray color codes

Gray is one of the named colors every browser understands. In CSS you can write it as gray or #808080. The spelling "grey" is an exact synonym.

FormatValue
HEX#808080
RGBrgb(128, 128, 128)
HSLhsl(0, 0%, 50%)
CMYK0%, 0%, 0%, 50%
CSS namegray
.example {
  color: gray;
  background-color: #808080;
  border-color: rgb(128, 128, 128);
}

Tints and shades of gray

Tints mix the color with white; shades mix it with black.

#F2F2F290% white
#DFDFDF75% white
#CCCCCC60% white
#B9B9B945% white
#A6A6A630% white
#93939315% white
#808080Base
Gray
#6D6D6D15% black
#5A5A5A30% black
#46464645% black
#33333360% black
#20202075% black
#0D0D0D90% black

Contrast and readability

Black text
5.32:1
passes AA
White text
3.95:1
large text only

Use black text on gray. Ratios follow the WCAG 2 formula; AA needs 4.5:1 for normal text and 3:1 for large text.

Frequently asked questions

What is the hex code for gray?

The hex code for gray is #808080.

What is the RGB value of gray?

Gray is rgb(128, 128, 128): 128 red, 128 green and 128 blue on a 0 to 255 scale.

Does gray have a complementary color?

No. Gray has no hue, so it has no complement. It pairs with any color.

Should text on gray be black or white?

Use black text. The contrast ratio is 5.32:1 with black and 3.95:1 with white. WCAG AA asks for at least 4.5:1 for normal text.

Similar named colors

Pick any other color with the color picker, or browse all named colors.