What colour contrast means and why it matters for web text
Contrast is the brightness gap between text and its background. Here's what it means, how it's scored, and who struggles when it's too low.
Contrast is the difference in brightness between your text and whatever sits behind it. That's the whole idea. Dark text on a pale page has plenty. Pale grey on white has very little, and it's a common way for a small site to end up hard to read.
It's about brightness, not colour
Two colours can look quite different and still be hard to tell apart. What matters is how bright each one is. In the web accessibility guidelines, WebAIM explains, contrast is a measure of the difference in perceived brightness between two colours. It's shown as a ratio that runs from 1 to 1 (white on white) up to 21 to 1 (black on white).1
That's why a vivid colour doesn't guarantee a readable one. On a white background, pure red works out at a ratio of 4 to 1, and pure green at only 1.4 to 1.1 Both are strong colours. One is close to unreadable as text.
The ratio doesn't care which colour is the text. Swap them and the number stays the same.1
What number to aim for is covered in WCAG contrast ratios explained. For now, the point is that contrast can be measured. It isn't only a feeling about whether a page looks nice.
Who has trouble when it's too low
"Low vision" is a broad label. It covers conditions that interfere with daily life and cannot be fully corrected by glasses. It's more common among older people, but it can occur at any age.2 So you can't assume your readers are young, or that they all see what you see on your own screen.
Cataracts are one example. They leave areas of opacity in the lens of the eye, and text may be hard to tell apart from its background. High contrast is especially important for people with advanced cataracts.2
Colour blindness is another. MDN says people with certain types of colour blindness, and similar conditions, have trouble differentiating between similar colours. They don't see bright and dark areas as readily as other people, so edges and borders are harder to pick out.3
It isn't only a problem for people with a diagnosis. MDN's view is that good contrast benefits all your users.3
Readers can change your colours
Some readers switch on a high contrast mode, or override a site's default colours in their browser or operating system.2 That helps them. It isn't a reason to skip the work. When those settings are on, they may not see your colours at all. When they're off, your choices are all they get.
More isn't always better
There's a ceiling, too. WebAIM notes that pure black on white can sometimes feel too contrasty and may be difficult to read.2 The aim is a page that's pleasant and readable, not the highest number possible.
What a check looks like
You'll need two colour values, a tool that reports the ratio, and a target. The guide to checking your own colours walks through that with free tools. Often the fix is small: a slightly darker grey, a heavier weight, a different button colour. A full redesign is rarely needed.
Text isn't the only thing that needs a check. Buttons, form borders and icons have their own rule, covered on the page about controls and icons.
Cited material
- Contrast and Color Accessibility, WebAIM, Utah State University
- Visual Disabilities - Low Vision, WebAIM, Utah State University
- Color contrast, MDN Web Docs, Mozilla