Contrast is the difference in brightness between text and its background. Too little, and text is hard to read for many people: those with low vision or colour vision deficiencies, anyone reading on a phone in sunlight, and most people as they get older. The Web Content Accessibility Guidelines (WCAG) set minimum contrast ratios, and they are the standard most accessibility laws and audits refer to.
How the ratio works
WCAG measures contrast as a ratio from 1:1, the same colour on itself, to 21:1, black on white. It is calculated from each colour’s relative luminance, how bright it looks once red, green and blue are weighted for the human eye. Hue does not matter directly: a red and a green of the same brightness have almost no contrast.
The thresholds
| Element | Level AA | Level AAA |
|---|---|---|
| Normal text | 4.5:1 | 7:1 |
| Large text | 3:1 | 4.5:1 |
| Icons, form borders and other interface parts | 3:1 | not set |
Large text means at least 18 point (about 24 CSS pixels), or 14 point (about 18.66 CSS pixels) if it is bold. AA is the level most organisations and laws aim for; AAA is stricter and harder to meet across a whole site.
So a good contrast ratio for body text is at least 4.5:1, and 7:1 or more is better still.
Worked examples
On a white background:
- #777777 (mid-grey) reaches 4.47:1: just short of 4.5:1, so it fails AA for normal text, though it passes for large text and icons.
- #767676, one step darker, reaches 4.54:1 and passes AA for all text.
- #595959 reaches 7.00:1, passing AAA.
On an orange background, #F08A4B:
- White text reaches only 2.48:1 and fails AA at any size.
- Black text reaches 8.44:1 and passes AAA.
That last pair surprises many designers: bright colours such as orange and yellow are light, so dark text on them works and white text does not.
The colour contrast checker gives the ratio for any pair of colours, a pass or fail at each level, and the nearest text colour that reaches 4.5:1 or 7:1.
Fixing a failing colour without changing the design
A contrast failure rarely needs a new colour scheme. Usually the fix is small:
- Darken the text a few steps while keeping the same hue. Mid-grey #777777 becomes #767676 and passes; the difference is invisible to most people.
- Use brand colours for large text and accents, where 3:1 is enough, and a darker shade of the same colour for body text.
- Swap white text for dark text on light, bright backgrounds such as orange, yellow and light green.
- Add a background behind text placed over photos or patterns.
The checker suggests the nearest text colour that reaches 4.5:1 or 7:1, so you can keep the look and meet the threshold.
Testing a whole site
Most sites use a small number of text styles. Test each one against every background it appears on:
- body text and headings;
- links, especially if they are not underlined, because colour may be the only cue;
- buttons, in their normal, hover and focus states;
- form labels, placeholders and error messages;
- captions, footers and small print, which are often the palest text on the page.
A spreadsheet of each colour pair and its ratio makes the check repeatable after any redesign.
The ratio is compared exactly
WCAG thresholds are minimums with no rounding: 4.49:1 fails 4.5:1. A tool that rounds 4.47 up to 4.5 reports a pass that an audit would not accept. Check the unrounded figure.
Common mistakes
- Light grey body text on white, chosen for a “clean” look. It is the most common contrast failure on the web.
- Placeholder text in form fields used as the only label, usually in pale grey.
- Text over images, where contrast changes across the picture. Add a solid or semi-transparent overlay behind the text and test the worst point.
- Transparent text, which is drawn blended with whatever is behind it. A 50% black on white is read as a mid-grey, about 4:1.
- Thin or decorative fonts, which need more contrast than the ratio suggests, because the thresholds assume ordinary letterforms.
- Colour alone carrying meaning, such as red for errors without an icon or text. Contrast does not fix this; a second cue does.
Contrast is one part of a readable page
Accessible pages need more than contrast: headings in a logical order, so screen readers can navigate; images described with meaningful alt text; and plain writing. The heading structure checker shows whether a page’s headings are in order, the image alt text checker lists images and their alt text, and our guide on Flesch reading ease scores covers the words themselves.
Contrast and SEO
Contrast is not a direct ranking factor, but text people struggle to read raises bounce rates and lowers engagement, and accessibility audits increasingly form part of how organisations judge a site. Fixing contrast is one of the cheapest accessibility improvements available: usually a change to a few colour values in a stylesheet.
Common questions
What contrast do placeholders need? If a placeholder carries information, it is text and needs 4.5:1. Better still, use a visible label and keep placeholders as examples.
Do focus outlines need contrast? Yes. The visible focus indicator for keyboard users is an interface element and needs enough contrast against its surroundings to be seen.
Does WCAG apply to logos? No. Text that is part of a logo or brand name has no contrast requirement.
What about disabled buttons? Inactive interface elements are exempt, though making them very faint can still confuse users.
Is 3:1 enough for body text? Only for large text. Normal-size body text needs at least 4.5:1 for AA.
Does dark mode change the rules? No. The same ratios apply to light text on dark backgrounds.
Limits of this guide
This covers the WCAG 2.2 contrast criteria. Readability also depends on font, size, spacing and the reader. Test with real users where you can, and check the full guidelines for other requirements.
Sources, read November 15, 2026:
- W3C, Understanding Success Criterion 1.4.3: Contrast (Minimum): the 4.5:1 and 3:1 thresholds, the definition of large text, and the exemption for logos.