Contrast is one of the few accessibility requirements that is completely objective. Either the ratio between text and background reaches the threshold, or it does not. There is no “looks fine on my monitor” exception, and the fix is usually a small change in lightness rather than a redesign.
This guide covers the thresholds, how the ratio is calculated, where interfaces commonly fail, and how to fix them.
The thresholds
WCAG 2.2 defines contrast requirements in success criteria 1.4.3 (AA) and 1.4.6 (AAA):
| Text | AA | AAA |
|---|---|---|
| Normal text (under 18 pt, or under 14 pt bold) | 4.5:1 | 7:1 |
| Large text (18 pt+, or 14 pt+ bold) | 3:1 | 4.5:1 |
| UI components and graphical objects | 3:1 | 3:1 |
“Large text” means roughly 24 px regular or 18.66 px bold. A 16 px label is normal text, even if it looks prominent. A 3:1 ratio is not a licence for small grey captions.
The UI component rule applies to input borders, focus indicators, icons that carry meaning and chart lines — anything a user must perceive to operate the interface.
How the ratio is calculated
Contrast is the ratio between the relative luminance of the lighter color and the darker one:
(L1 + 0.05) / (L2 + 0.05)
Relative luminance is not the average of the RGB values. Each channel is converted to linear light first:
c = channel / 255
c_lin = c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ^ 2.4
L = 0.2126 * R_lin + 0.7152 * G_lin + 0.0722 * B_lin
Two consequences follow:
- Green contributes most to perceived brightness. Bright green on white can look vivid and still fail at 3:1.
- Saturated colors are deceptive. A rich blue or red can look strong but have low luminance difference from the background.
Because the formula is not intuitive, guessing is unreliable. Use a calculator.
Where interfaces actually fail
- Brand color as body text. A brand color chosen for a logo is often too light for paragraphs. Use it for accents and links, and a darker shade for text.
- Placeholder text. Placeholders are commonly set to 30–40% grey, which rarely reaches 4.5:1. Placeholders are text and must meet the normal-text threshold.
- Disabled states. There is an exception for inactive controls, but if a user must read the label to understand the state, aim for 3:1 anyway.
- Text over images or gradients. The ratio depends on the worst pixel behind the text. Add a solid scrim or a text shadow rather than assuming the photo is dark enough.
- Dark mode. Inverting a palette does not preserve contrast. A light theme that passes AA can produce 3:1 body text when the same values are flipped.
- Thin type and low weight. WCAG does not increase the required ratio for thin fonts, but thin strokes at the same ratio are visibly harder to read.
Fixing contrast without redesigning
The most reliable fix is to move lightness, not hue:
- Darken the text until it passes. Keep the hue and saturation; reduce the lightness.
- Lighten the background if the design can tolerate it. This usually looks softer than near-black text.
- Avoid pure black on pure white if you want a calmer page;
#111827on#ffffffis about 17:1 and still passes everything comfortably. - Test both themes separately. Pick the pairs in each theme and verify them, rather than deriving one from the other.
What does not work:
- Adding a thin outline or shadow to make text “pop”. It can help perceived legibility, but it does not change the measured ratio.
- Increasing font weight only. Bold text has a lower threshold only at 14 pt and above.
- Relying on color alone to convey state. Pair color with an icon, a label or an underline.
Checking a palette
A practical workflow for a design system:
- Pick the text/background pairs that appear in the UI, not every combination.
- Check each pair at the intended size.
- Record the ratio next to the token, so future changes can be reviewed.
- Re-check after any theme change, including brand refreshes.
- Include focus rings, borders and disabled states in the audit.
The Contrast Checker computes the ratio for any foreground and background pair and tells you whether it passes AA or AAA for normal and large text. If your colors are stored as hex, RGB or HSL, the Color Converter converts between formats first. When text sits on a gradient, use the Gradient Generator to inspect the darkest and lightest stops — the worst stop is the one that decides whether the text is readable.
A short checklist
- Body text: 4.5:1 minimum, 7:1 for AAA.
- Large text: 3:1 minimum, 4.5:1 for AAA.
- Borders, icons and focus rings: 3:1.
- Check placeholders, captions, disabled labels and text over images.
- Verify light and dark themes independently.
- Move lightness, keep hue, and re-measure instead of trusting your eyes.
Contrast is measurable, so it should never be a matter of opinion in review. Measure the pair, write down the ratio, and fix the colors before the accessibility audit finds them for you.