Shades of Gray: Names, HEX & RGB Codes

Grays are the backbone of most interfaces: backgrounds, borders, secondary text. These are the CSS named grays (plus black and white) with their codes and contrast against text.

12 named gray colors in CSS

Every name below works directly in CSS (for example color: lightslategray;). Values are from the CSS Color Module Level 4 list; the last column shows whether white or black text has more contrast on that color, and the exact WCAG ratio.

NameHEXRGBHSLBest text color
White
white
#FFFFFFrgb(255, 255, 255)hsl(0, 0%, 100%)black text, 21.00:1
White Smoke
whitesmoke
#F5F5F5rgb(245, 245, 245)hsl(0, 0%, 96%)black text, 19.26:1
Gainsboro
gainsboro
#DCDCDCrgb(220, 220, 220)hsl(0, 0%, 86%)black text, 15.31:1
Light Gray
lightgray
#D3D3D3rgb(211, 211, 211)hsl(0, 0%, 83%)black text, 14.02:1
Silver
silver
#C0C0C0rgb(192, 192, 192)hsl(0, 0%, 75%)black text, 11.54:1
Dark Gray
darkgray
#A9A9A9rgb(169, 169, 169)hsl(0, 0%, 66%)black text, 8.93:1
Light Slate Gray
lightslategray
#778899rgb(119, 136, 153)hsl(210, 14%, 53%)black text, 5.76:1
Gray
gray
#808080rgb(128, 128, 128)hsl(0, 0%, 50%)black text, 5.31:1
Slate Gray
slategray
#708090rgb(112, 128, 144)hsl(210, 13%, 50%)black text, 5.17:1
Dim Gray
dimgray
#696969rgb(105, 105, 105)hsl(0, 0%, 41%)white text, 5.48:1
Dark Slate Gray
darkslategray
#2F4F4Frgb(47, 79, 79)hsl(180, 25%, 25%)white text, 8.92:1
Black
black
#000000rgb(0, 0, 0)hsl(0, 0%, 0%)white text, 21.00:1

Gray tint & shade scale

A ten-step scale built from gray (#808080). Need a scale for your own color? Use the tints, shades & tones generator.

F2F2F2
DFDFDF
CCCCCC
B3B3B3
999999
808080
666666
4D4D4D
333333
202020

Tints (mixed with white) on the left, shades (mixed with black) on the right. Click a swatch to copy it.

Using gray in design

A quirk worth knowing: in CSS, darkgray (#A9A9A9) is actually lighter than gray (#808080), a leftover from the X11 color list. Every gray name also has a "grey" spelling (grey, darkgrey, slategrey and so on) with the same value. For body text on white, #767676 is the lightest neutral gray that passes WCAG AA (4.54:1); gray (#808080) only reaches 3.94:1.

A palette to start from

D4D4D4
A3A3A3
737373
404040
171717

More ideas: dark mode palettes, contrast & readability, or check any pair in the contrast checker.

Other color families