Shades of Gray
Named shades of gray
| Name | Hex | RGB | HSL | |
|---|---|---|---|---|
| Black | #000000 | rgb(0, 0, 0) | hsl(0.0, 0.0%, 0%) | |
| Darkslategray | #2F4F4F | rgb(47, 79, 79) | hsl(180, 25%, 25%) | |
| Dimgray | #696969 | rgb(105, 105, 105) | hsl(0.0, 0.0%, 41%) | |
| Slategray | #708090 | rgb(112, 128, 144) | hsl(210, 13%, 50%) | |
| Gray | #808080 | rgb(128, 128, 128) | hsl(0.0, 0.0%, 50%) | |
| Lightslategray | #778899 | rgb(119, 136, 153) | hsl(210, 14%, 53%) | |
| Darkgray | #A9A9A9 | rgb(169, 169, 169) | hsl(0.0, 0.0%, 66%) | |
| Silver | #C0C0C0 | rgb(192, 192, 192) | hsl(0.0, 0.0%, 75%) | |
| Lightgray | #D3D3D3 | rgb(211, 211, 211) | hsl(0.0, 0.0%, 83%) | |
| Gainsboro | #DCDCDC | rgb(220, 220, 220) | hsl(0.0, 0.0%, 86%) | |
| Whitesmoke | #F5F5F5 | rgb(245, 245, 245) | hsl(0.0, 0.0%, 96%) | |
| White | #FFFFFF | rgb(255, 255, 255) | hsl(0.0, 0.0%, 100%) |
12 named shades of gray with hex, RGB, and HSL codes, a contrast table for every gray (vs white and vs black), and a ladder tool that builds tints and shades from any gray. Click a ladder step to set it as the current color; the table's Copy buttons copy a code.
Gray runs from pure black to pure white in even steps. This page lists 12 named grays, each with its exact hex code, a contrast table for every gray, and a tool that builds a tint and shade ladder from any gray.
What counts as a shade of gray?
Every color on this page is a named CSS color in the gray family — real, standard colors with exact hex codes, not approximations. The ladder tool above takes any gray and builds its tints (mixed toward white) and shades (mixed toward black) in ten even steps, so you can pick the exact lightness you need instead of guessing.
When you pair a gray with other colors, the classic partners are its complement and neutrals like white, charcoal, and beige. Use the complementary colors tool to find the exact complement of any shade on this page.
Gray contrast: which grays work as text?
Gray is the one family where contrast is the whole story. Read the table this way: “vs White” is the contrast of the gray used as text on a white background, and “vs Black” is the same gray on a black background. WCAG 2.1 asks for 4.5:1 for normal text (AA) and 7:1 for AAA.
| Gray | Hex | vs White | vs Black | Best text color |
|---|---|---|---|---|
| Black | #000000 | 21.00:1 | 1.00:1 | White |
| Darkslategray | #2F4F4F | 8.93:1 | 2.35:1 | White |
| Dimgray | #696969 | 5.49:1 | 3.83:1 | White |
| Slategray | #708090 | 4.05:1 | 5.18:1 | Black |
| Gray | #808080 | 3.95:1 | 5.32:1 | Black |
| Lightslategray | #778899 | 3.64:1 | 5.77:1 | Black |
| Darkgray | #A9A9A9 | 2.35:1 | 8.94:1 | Black |
| Silver | #C0C0C0 | 1.82:1 | 11.54:1 | Black |
| Lightgray | #D3D3D3 | 1.50:1 | 14.03:1 | Black |
| Gainsboro | #DCDCDC | 1.37:1 | 15.31:1 | Black |
| Whitesmoke | #F5F5F5 | 1.09:1 | 19.26:1 | Black |
| White | #FFFFFF | 1.00:1 | 21.00:1 | Black |
Only the three darkest grays — black, dark slate gray, and dim gray — pass AA as text on white. Everything lighter fails on white and needs black text on top of it instead, or a dark background behind it. That is why body text is almost always a dark gray, never a mid gray.
Frequently asked questions
What is the hex code for gray?
Gray is #808080. In RGB that is rgb(128, 128, 128).
What is the difference between gray and grey?
Nothing — gray and grey are two spellings of the same color (#808080), and both work in CSS. The same goes for darkgray/darkgrey, lightgray/lightgrey, dimgray/dimgrey, and slategray/slategrey.
Which gray is best for body text?
Dark gray. Dimgray (#696969) on white scores 5.49:1 and passes WCAG AA for normal text; mid-gray (#808080) scores 3.95:1 and fails AA for normal text, so use it only for large text or secondary elements.
What is the contrast ratio of black on white?
21.00:1 — the highest possible. White on black is the same 21.00:1.
Related tools
Gray · Contrast Checker · Palette Generator · Shades of Black · Shades of White