Colour Contrast for Readable, Accessible Design
🎨 Try it: Color Converter & Contrast Checker →Low-contrast text, like light grey on white, looks sleek in a design mockup but is hard to read for many people: anyone with low vision, older readers, people on phones in bright sunlight, and anyone on a cheap screen. Good contrast makes a site easier for everyone.
How contrast is measured
The Web Content Accessibility Guidelines (WCAG) define a contrast ratio between two colours, from 1:1 (identical) to 21:1 (black on white). It is based on each colour's relative luminance, a measure of perceived brightness that weights green most heavily and blue least.
Contrast = (lighter luminance + 0.05) ÷ (darker luminance + 0.05)
The thresholds to aim for
| Content | Level AA | Level AAA |
|---|---|---|
| Normal text | 4.5:1 | 7:1 |
| Large text (≈24px, or ≈19px bold) | 3:1 | 4.5:1 |
| Icons, borders, chart lines | 3:1 | - |
Many laws and procurement standards around the world reference WCAG level AA, so 4.5:1 for body text is a sensible minimum.
Worked examples on a white background
| Text colour | Contrast with white | Result |
|---|---|---|
| #595959 | 7.00:1 | AAA |
| #767676 | 4.54:1 | AA (just) |
| #777777 | 4.48:1 | Fails AA for normal text |
| #999999 | 2.85:1 | Fails, even for large text |
| #4f46e5 (indigo) | 6.29:1 | AA |
Notice how #767676 passes but #777777, one step lighter, does not. Contrast is a hard line, so it pays to check rather than eyeball. Use the colour converter and contrast checker.
Practical tips
- Check text on every background it appears on, including buttons, banners and images.
- Don't rely on colour alone. Pair colour with text, icons or patterns, for example an error icon plus a message, not just red text. About 1 in 12 men and 1 in 200 women have some form of colour vision deficiency.
- Mind placeholder and disabled text. They are often far too light to read.
- Test dark mode separately. A colour that passes on white may fail on a dark background.
- Avoid pure black on pure white for long reading if you find it harsh; a very dark grey like #1a1a1a still gives excellent contrast.
Colour formats in a nutshell
- HEX (
#4f46e5): compact and common in CSS and design tools. - RGB (
rgb(79, 70, 229)): red, green and blue from 0 to 255. - HSL (
hsl(243, 75%, 59%)): hue, saturation and lightness. Handy for making lighter or darker shades: keep the hue and adjust lightness until contrast passes.
Why it matters for your site
Readable text keeps visitors on the page longer, reduces mistakes in forms, and widens your audience. Accessibility is also increasingly a legal requirement for public-facing websites in many countries.