Shades of Gray
Every useful gray, generated rather than hand-listed.
There are 52 named CSS colors in the gray family, ranging from White (#ffffff) at the light end to Black (#000000) at the dark end. The shades generated on this page all sit at hue 258° in OKLCH, so their lightness steps look evenly spaced instead of bunching up in the shadows the way an HSL ramp does.
Every shade of gray on this page is generated, not copied from a list. Each swatch sits at hue 258° in OKLCH with an even perceptual lightness step, so the ramp reads smoothly instead of bunching up at the dark end the way an HSL ramp does — and nothing is clipped outside what an sRGB display can actually show.
Click any swatch to copy its hex code. The sliders let you change how many shades you get, how intense they are, and how much the hue drifts across the ramp.
Three gray shades worth starting from
If you just need a gray that works, these three are safe picks at the light, mid and dark ends of the range.
| Role | Hex | RGB | Contrast on white |
|---|---|---|---|
| Light gray — backgrounds, tints | #c0d9ff | rgb(192 217 255) | 1.44:1 |
| Mid gray — accents, buttons | #3d7ede | rgb(61 126 222) | 4.01:1 |
| Dark gray — text, borders | #002f6e | rgb(0 47 110) | 12.87:1 |
Named shades of gray
24 named colors that fall in the gray range, sorted from darkest to lightest, with the contrast ratio each one achieves against a white background. Anything below 4.5:1 is not safe for body text on white.
| Name | Hex | RGB | HSL | On white |
|---|---|---|---|---|
| Black | #000000 | rgb(0 0 0) | hsl(0 0% 0%) | 21:1 |
| Raven | #0a0a0a | rgb(10 10 10) | hsl(0 0% 3.9%) | 19.8:1 |
| Obsidian | #0b0b0d | rgb(11 11 13) | hsl(240 8.3% 4.7%) | 19.66:1 |
| Licorice | #1a1110 | rgb(26 17 16) | hsl(6 23.8% 8.2%) | 18.56:1 |
| Carbon | #1c1c1c | rgb(28 28 28) | hsl(0 0% 11%) | 17.04:1 |
| Soot | #1f1f1f | rgb(31 31 31) | hsl(0 0% 12.2%) | 16.48:1 |
| Raisin | #242124 | rgb(36 33 36) | hsl(300 4.3% 13.5%) | 15.93:1 |
| Volcanic | #2c2320 | rgb(44 35 32) | hsl(15 15.8% 14.9%) | 15.35:1 |
| Gunmetal | #2a3439 | rgb(42 52 57) | hsl(200 15.2% 19.4%) | 12.74:1 |
| Black Coffee | #3b2f2f | rgb(59 47 47) | hsl(0 11.3% 20.8%) | 12.85:1 |
| Jet | #343434 | rgb(52 52 52) | hsl(0 0% 20.4%) | 12.45:1 |
| Onyx | #353839 | rgb(53 56 57) | hsl(195 3.6% 21.6%) | 11.82:1 |
| Graphite | #383838 | rgb(56 56 56) | hsl(0 0% 22%) | 11.73:1 |
| Iron | #484848 | rgb(72 72 72) | hsl(0 0% 28.2%) | 9.15:1 |
| Basalt | #4b4b4d | rgb(75 75 77) | hsl(240 1.3% 29.8%) | 8.7:1 |
| Thunder | #4d4d4f | rgb(77 77 79) | hsl(240 1.3% 30.6%) | 8.43:1 |
| Dimgray | #696969 | rgb(105 105 105) | hsl(0 0% 41.2%) | 5.49:1 |
| Flint | #6f6a61 | rgb(111 106 97) | hsl(38.6 6.7% 40.8%) | 5.37:1 |
| Dove Gray | #6d6c6c | rgb(109 108 108) | hsl(0 0.5% 42.5%) | 5.23:1 |
| Nickel | #727472 | rgb(114 116 114) | hsl(120 0.9% 45.1%) | 4.71:1 |
| Steel | #71797e | rgb(113 121 126) | hsl(203.1 5.4% 46.9%) | 4.43:1 |
| Wolf Gray | #7c7c7c | rgb(124 124 124) | hsl(0 0% 48.6%) | 4.17:1 |
| Gray | #808080 | rgb(128 128 128) | hsl(0 0% 50.2%) | 3.95:1 |
| Titanium | #878681 | rgb(135 134 129) | hsl(50 2.4% 51.8%) | 3.65:1 |
Using gray in an interface
The two badges next to each generated shade are its contrast ratio against white and against black. The first step where one of them turns green is the lightest gray you can safely set body text in on that background — everything lighter is decoration, not copy.
For large areas, pick from the light end and let a darker shade of the same hue carry the text. That keeps the whole surface in one hue family, which is what makes an interface feel deliberate rather than assembled.
Frequently asked questions
What are the hex codes for shades of gray?
The ramp at the top of this page generates them — click any swatch to copy it. Three reliable picks are #c0d9ff for light, #3d7ede for mid and #002f6e for dark gray.
What is the hex code for gray?
The closest single answer is Graphite at #383838, but gray is a range rather than one value. This page lists 24 named gray shades and generates as many more as you want.
How many shades of gray are there?
Effectively unlimited — an 8-bit display can show over 16 million colors, and a large share of them read as this family. The useful question is how many distinguishable steps you need, which is usually somewhere between 9 and 12 for a design system.
What colors go well with gray?
Its perceptual complement sits at hue 78°, and the two neighbors either side of that make a softer split-complementary set. The palette generator builds all of them from any starting gray.
Which shade of gray is accessible for text?
On a white background you need 4.5:1 for body text. In the table above that is every row at or above 4.5:1 — generally the darker half of the family. The contrast checker will confirm any specific pair and suggest the nearest passing color if it fails.