Shades of Gray: Color Names & Hex Codes

There are 8 CSS named colors in the gray range, from the lightest, Gainsboro, to the darkest, Dark Slate Gray. Each one below has its exact hex and RGB code, the text color that reads best on it, and a full page with palettes and matching colors.

Gray Color Chart

Ordered from lightest to darkest by relative luminance. Click a name for its full color page.

#DCDCDC

Gainsboro

rgb(220, 220, 220) · gainsboro

Very pale neutral gray, just lighter than light gray.

#D3D3D3

Light Gray

rgb(211, 211, 211) · lightgray

Very light neutral gray.

#C0C0C0

Silver

rgb(192, 192, 192) · silver

Light neutral gray.

#A9A9A9

Dark Gray

rgb(169, 169, 169) · darkgray

Actually lighter than CSS gray.

#808080

Gray

rgb(128, 128, 128) · gray

CSS gray: neutral, exactly half strength.

#708090

Slate Gray

rgb(112, 128, 144) · slategray

Cool blue-tinted gray.

#696969

Dim Gray

rgb(105, 105, 105) · dimgray

Dark neutral gray, darker than gray.

#2F4F4F

Dark Slate Gray

rgb(47, 79, 79) · darkslategray

Near-black gray with a teal tint.

Light, Mid-tone and Dark Shades of Gray

Light shades of gray

Pale enough to work as backgrounds. Black text has the higher contrast on all 3 of them. Gainsboro, Light Gray and Silver.

Mid-tone shades of gray

Mid-tones for accents, buttons and illustrations. Check the table below before choosing a text color. Black text has the higher contrast on all 3 of them. Dark Gray, Gray and Slate Gray.

Dark shades of gray

Deep tones for headers, buttons and bold brand color. White text has the higher contrast on all 2 of them. Dim Gray and Dark Slate Gray.

Gray Hex Codes and Contrast

Contrast ratios follow WCAG 2.2: 4.5:1 is the minimum for body text, 3:1 for large text.

Gray-range named colors in CSS Color 4
ColorHEXRGBHSLOn blackOn whiteBest text
#DCDCDCrgb(220, 220, 220)hsl(0, 0%, 86%)15.31:11.37:1Black
#D3D3D3rgb(211, 211, 211)hsl(0, 0%, 83%)14.03:11.5:1Black
#C0C0C0rgb(192, 192, 192)hsl(0, 0%, 75%)11.54:11.82:1Black
#A9A9A9rgb(169, 169, 169)hsl(0, 0%, 66%)8.94:12.35:1Black
#808080rgb(128, 128, 128)hsl(0, 0%, 50%)5.32:13.95:1Black
#708090rgb(112, 128, 144)hsl(210, 13%, 50%)5.18:14.05:1Black
#696969rgb(105, 105, 105)hsl(0, 0%, 41%)3.83:15.49:1White
#2F4F4Frgb(47, 79, 79)hsl(180, 25%, 25%)2.35:18.93:1White

Shades of Gray FAQ

What are the shades of gray in CSS?

CSS Color 4 does not group its named colors into families, but 8 of them fall in the gray range. From lightest to darkest: Gainsboro (#DCDCDC), Light Gray (#D3D3D3), Silver (#C0C0C0), Dark Gray (#A9A9A9), Gray (#808080), Slate Gray (#708090), Dim Gray (#696969) and Dark Slate Gray (#2F4F4F).

What is the hex code for gray?

The CSS named color gray is #808080, which is RGB(128, 128, 128). The other shades on this page each have their own code.

Which shade of gray can I use for text on a white background?

Dim Gray and Dark Slate Gray are the only ones of these shades with at least 4.5:1 contrast on white, the WCAG AA minimum for body text. Dark Slate Gray reaches 8.93:1.

Is it gray or grey?

Both spellings work in CSS. Every gray named color also accepts the grey spelling, so dimgray and dimgrey, or slategray and slategrey, are the same colors.

Sources: W3C CSS Color Module Level 4 (named colors and values); WCAG 2.2 (relative luminance and contrast formula).