You have picked grey for your new site, and now every swatch looks either flat or hard to read. The hex codes are easy to find, but knowing which grey belongs to the background, the text or the border is harder. See https://coolors.co.
A grey website palette works as a ladder of steps, not a single color. Start with a near-white for the page background. Add a slightly darker step for surfaces such as cards. Then add a mid-tone for borders, and finish with one or two dark greys for text.
Add a single accent color for buttons and links, because grey alone gives users no obvious thing to click. The examples below show how well-known design systems solve this, with hex codes taken from their published documentation.
How grey colors work on the web
A web color is written in hexadecimal (base 16): #RRGGBB, where each pair is the amount of red, green and blue light from 00 to FF. Each channel runs from 0 to 255, which gives more than 16 million possible colors. A pure neutral grey has three identical pairs, such as #808080, which is 50% red, 50% green and 50% blue.
As soon as one pair differs, the grey gains an undertone, a faint hint of blue (cooler) or brown (warmer). Grey is achromatic, meaning it has no hue (the basic color family, such as red or blue) of its own. The undertone is the only hue a grey can carry.
The word “shade” is often used loosely. Strictly, a shade is a color darkened with black, a tint is lightened with white, and a tone is mixed with grey. A grey spectrum from near-white to near-black is therefore a set of steps between the two parents, white and black.

Named CSS greys and the grey/gray spelling
CSS (the language that styles web pages) ships named greys. They are worth knowing, but they are not a designed scale.
| CSS name | Hex |
|---|---|
| whitesmoke | #F5F5F5 |
| gainsboro | #DCDCDC |
| lightgray | #D3D3D3 |
| darkgray | #A9A9A9 |
| gray | #808080 |
| dimgray | #696969 |
The names contain an oddity: gray is darker than darkgray. CSS inherited its names from the older X11 standard, which defined gray as a lighter value. CSS then fixed gray at the midpoint of the 8-bit scale, (128, 128, 128). colormagic.app walks through the specifics.
In CSS the names are spelled gray. Modern browsers also accept grey, but early versions of Internet Explorer did not. Hex codes avoid the question entirely.
The old 216-color web-safe palette was built for screens that could show only 256 colors, and it reserved 40 fixed system colors. It includes only a few greys: #333333, #666666, #999999 and #CCCCCC. Most computers now display millions of colors, so this limit no longer applies and you can pick any step you need.
How the contrast ratios below were calculated
Every ratio in this article uses the formula from the Web Content Accessibility Guidelines (WCAG) 2.2. It compares the relative luminance (perceived brightness) of two colors. The result runs from 1:1 (identical colors) to 21:1 (black on white), and you can reproduce it in any contrast checker.
WCAG success criterion 1.4.3 asks for at least 4.5:1 for normal text and 3:1 for large text. Criterion 1.4.11 asks for 3:1 for the parts of interface components needed to identify them, such as input outlines. Level AAA, a stricter tier, asks for 7:1 for normal text.
The hex codes come from each system’s official documentation. The roles (background, surface, text, border) are the typical use of each step, not a transcript of every page of the site. Design systems change, so re-check the current documentation before you copy a value into production.

Tailwind CSS gray scale (version 3 default)
What it shows: a cool grey with a slight blue undertone, in eleven steps. What it solves: it gives product teams a ready ladder, so nobody has to choose a grey from scratch for each element.
| Step | Hex | Suggested role | Contrast on white |
|---|---|---|---|
| gray-50 | #F9FAFB |
Page background | Not applicable |
| gray-100 | #F3F4F6 |
Surface | Not applicable |
| gray-200 | #E5E7EB |
Divider, border | About 1.2:1 |
| gray-400 | #9CA3AF |
Placeholder, icons | 2.54:1 |
| gray-500 | #6B7280 |
Secondary text | 4.83:1 |
| gray-700 | #374151 |
Body text | 10.31:1 |
| gray-900 | #111827 |
Headings, dark backdrop | About 17.7:1 |
What to reuse: the jump from gray-400 to gray-500 is the one to remember. Gray-400 fails for text on white, while gray-500 passes. The line between decorative and readable sits between those two steps. Source: Tailwind CSS documentation, default color palette, version 3. Check the documentation again before mixing versions.
IBM Carbon, the neutral grey of enterprise interfaces
What it shows: a grey scale from Gray 10 to Gray 100, used with a single blue for actions. What it solves: dense data screens that need many layers without visual noise.
- Background:
#FFFFFF, with Gray 10#F4F4F4as the surface for layered panels. - Border: Gray 20
#E0E0E0for dividers. - Secondary text: Gray 70
#525252, which reaches 7.81:1 on white and 7.10:1 on#F4F4F4. - Primary text: Gray 100
#161616, about 18.1:1 on white. - Button: the primary action uses blue
#0F62FE, never grey.
What to reuse: the secondary text grey keeps AAA-level contrast (7:1) even on the tinted surface. You can therefore stack a card on a background without losing legibility. Gray 50 #8D8D8D reaches only 3.32:1 on white. Keep it for icons and input outlines, which need 3:1, and not for text. Source: Carbon Design System, color and themes documentation, White theme.

Bootstrap 5 grays, the most common default
What it shows: a slightly cool scale from gray-100 #F8F9FA to gray-900 #212529. What it solves: it makes a plain, balanced layout possible with no custom design work.
- Background:
#F8F9FA(gray-100) or white. - Surface and border:
#E9ECEF(gray-200),#DEE2E6(gray-300) and#CED4DA(gray-400), the last of which frames form fields. - Muted text:
#6C757D(gray-600), which gives 4.69:1 on white. - Body text:
#212529(gray-900), about 15.4:1 on white.
What to reuse, and what to watch: the same muted grey on the gray-100 background drops to about 4.4:1, just under the 4.5:1 threshold. A color that passes on white can fail on a tinted surface. Always test each text and background pair you actually ship. Source: Bootstrap 5 documentation, color section.
Material Design grey, the neutral alternative
What it shows: a pure, undertone-free grey scale, from 50 #FAFAFA to 900 #212121. What it solves: it stays out of the way of strongly colored brands, because it adds neither warmth nor coolness.
- Background:
#FAFAFA(50) and surface#F5F5F5(100). - Border:
#E0E0E0(300). - Disabled or hint text:
#9E9E9E(500), 2.68:1 on white, so it does not meet text contrast. - Secondary text:
#757575(600), 4.61:1 on white, a narrow pass. - Primary text:
#212121(900), about 16.1:1 on white.
What to reuse: if your brand color is intense, such as a saturated red or orange, a neutral grey keeps it from clashing. A tinted grey can compete with it. Source: Material Design 2 color palette documentation. colorhunt.co published something useful on the subject.

Choosing between cool, neutral and warm greys
Grey carries a reputation for neutrality, professionalism and sophistication, and lighter greys can feel calm. Darker tones add seriousness and depth. Too much grey, though, can make a design feel dull, cold or even depressing. The undertone decides the mood more than the lightness does.
- Cool grey (blue undertone, as in Tailwind): feels technical and modern. It pairs well with blue, teal and green accents.
- Neutral grey (as in Material): the safest base behind photography and strong brand colors.
- Warm grey (brown or beige undertone): feels softer and more editorial. It suits blush pink, mustard and burnt orange accents.
Keep one undertone across the whole scale. Mixing a cool grey text with a warm grey background creates a subtle mismatch that users feel without being able to name it.
Accent colors that work with grey
Because grey is neutral, it combines with almost any color. These pairings show how the accent changes the feel of the page.
- Red and grey: a passionate, dramatic combination. A crimson red gives a burst of energy without overwhelming the calm of the grey, and using both dark and light greys keeps the page balanced.
- Mustard and grey: moody and rich. Mustard against a dark grey feels opulent and adds brightness without becoming too intense.
- Green and grey: fresh and natural. Subtle greens sit well beside grey, like moss on a stone.
- Teal and grey: match the grey to the teal’s strength. A bright teal with pale grey looks clean and modern, while a darker pair feels richer.
- Blush pink and grey: romantic and soft, and a popular choice for gentle, personal brands.
- Blue and grey: a natural pair. A soft light grey calms a blue that might otherwise feel overpowering, and blue-grey gives a clean, modern look.
Extremely saturated colors, such as neon green, a vivid rose or pure yellow, can clash with mid-tone grey and create harsh visual tension. Off-white is another safe partner for an elegant effect. Whichever accent you choose, run it through the contrast test below.
A starter grey palette you can adapt
This example borrows the structure shared by the systems above, using Tailwind values. Treat it as a starting point and replace the accent with your brand color.
:root {
--bg: #F9FAFB; /* page background */
--surface: #FFFFFF; /* cards, modals */
--border: #E5E7EB; /* dividers */
--text-muted: #6B7280;/* 4.83:1 on white */
--text: #111827; /* about 17.7:1 on white */
--accent: #2563EB; /* buttons, links: test it yourself */
}
Before you launch, test every text and surface pair with a WCAG contrast checker. Check the button label against the button color. Confirm that a focus outline keeps at least 3:1 against its surroundings. Also test on a real phone, because screen brightness changes how light greys such as the border step appear.
Keep in mind before you pick your greys
Build the palette as a ladder with a single undertone. Reserve the lightest steps for background and surface, and keep text at the darker end.
Treat the mid-greys with suspicion, because steps around 400 to 500 sit right on the edge of failing WCAG contrast. A tinted background can tip them over. Verify each pair yourself instead of trusting a scale’s reputation.
Take the scale from the system closest to your product, then test it in your own layout. If you plan a redesign, document your final hex codes and their roles in one shared stylesheet so every page stays consistent.
