Skip to content

Gray (Grey)

Gray is a true neutral, with equal parts red, green and blue. Hex code #808080.

Gray#808080

Gray color codes

  • CSS namegray, grey
  • HEX#808080
  • RGBrgb(128, 128, 128)
  • HSLhsl(0, 0%, 50%)
  • OKLCHoklch(60% 0 0)
HSB and CMYK values
  • HSB / HSVhsb(0, 0%, 50%)
  • CMYKC0 M0 Y0 K50

White text

3.94:1 · passes WCAG AA for large text only

Black text

5.31:1 · passes WCAG AA

Shades of gray

A darker shade of gray is #4F4F4F (600), and a lighter one is #B8B8B8 (200).

Colors that go with gray

Tones

Gray has no complementary color: grays, black and white have no hue to turn around the color wheel.

Click a color to copy its hex code.

Colors similar to gray

Each compared with gray.

About this color

Gray in CSS and design

Gray is one of the 16 basic color keywords, which come from the VGA palette by way of HTML. These four lines all give the same gray:

color: gray;
color: #808080;
color: rgb(128, 128, 128);
color: hsl(0, 0%, 50%);

What to know about gray

CSS gray is #808080, each channel at 128, half of 255. It is darker than dark gray (#A9A9A9) because the two come from different lists: dark gray comes from the X11 color list, whose own gray is the much lighter #BEBEBE. The CSS Color specification keeps these names not because they are good but because they have been in use for decades. Every gray name also works with the grey spelling.

Gray and the other grays

Gray sits between slate gray (#708090) and light slate gray (#778899) in lightness. As text on gray, black reaches the 4.5:1 contrast that WCAG AA asks for.

GrayHexLightnessContrast with gray
Black#0000000%5.31:1
Dark slate gray#2F4F4F40%2.26:1
Dim gray#69696952%1.39:1
Slate gray#70809059%1.02:1
Gray#80808060%–
Light slate gray#77889962%1.08:1
Dark gray#A9A9A973%1.68:1
Silver#C0C0C081%2.17:1
Light gray#D3D3D387%2.63:1
Gainsboro#DCDCDC89%2.88:1
White smoke#F5F5F597%3.62:1
White#FFFFFF100%3.94:1

Lightness is OKLCH lightness, which follows how light a color looks.

Frequently asked questions

What is the hex code for gray (grey)?

#808080. Gray and grey are two spellings for the same color, and CSS accepts both keywords, gray and grey, in every browser.

What is gray in RGB and HSL?

In RGB it is rgb(128, 128, 128) and in HSL hsl(0, 0%, 50%). In CMYK it is about C0 M0 Y0 K50, though printed colors vary with paper and ink.

Should I use black or white text on gray?

Black text works better: it has a contrast ratio of 5.31:1 and passes WCAG AA. White text reaches 3.94:1.

What is the complementary color of gray?

Gray has no complementary color. A complement is found by turning a color's hue halfway around the color wheel, and grays, black and white have no hue to turn.

Which colors go with gray?

As a neutral, gray goes with almost any color. Its own tones, from #2E2E2E to #B7B7B7, make a calm palette, and a single vivid accent stands out against it.