Low color contrast is one of the most common accessibility failures on the web. Light gray text on white, white text on a pale brand color and faint placeholder text are hard to read for people with low vision, for older users and for anyone using a phone in sunlight. The good news is that it is also one of the easiest problems to measure and fix. This guide shows how to fix color contrast issues step by step, using the ratios WCAG requires.
The WCAG Contrast Ratios
Contrast is measured as a ratio between the lighter and darker color, from 1:1 (no contrast) to 21:1 (black on white).
| What | Level AA | Level AAA | WCAG criterion |
|---|---|---|---|
| Normal text | 4.5:1 | 7:1 | 1.4.3 / 1.4.6 |
| Large text (24px, or 18.66px bold, and up) | 3:1 | 4.5:1 | 1.4.3 / 1.4.6 |
| Buttons, input borders, icons, focus indicators | 3:1 | 3:1 | 1.4.11 |
| Logos and purely decorative text | No requirement | No requirement | |
| Disabled controls | No requirement | No requirement |
Most laws and policies require Level AA, so 4.5:1 for normal text is the number to remember. The WCAG 2.2 checklist lists every related criterion.
Step 1: Find the Failing Colors
- Run the page through the color contrast checker or a full accessibility audit. Both test the page in a real browser, so they measure the colors as actually rendered, including text over CSS backgrounds.
- Check pages while you build with the accessibility extension for Chrome, which also works on pages behind a login.
- Check the states tools often miss: hover and focus styles, error messages, placeholder text, text on images or gradients, and dark mode.
Automated tools reliably fix color contrast problems in solid text, but they cannot always measure text on photos, gradients or video. Check those by eye with a color picker.
Step 2: Fix Color Contrast in Text
Usually the fastest fix is to darken the text, not change the background.
- Gray text: on a white background, the lightest gray that passes 4.5:1 is around
#767676. - Brand colors: keep the hue and change the lightness. A darker shade of the same blue or green usually passes and still looks on-brand. Save it as a separate "text" token in your design system.
- White text on buttons: if your brand color is light, such as yellow or light green, use dark text on it instead of white.
- Text on images: add a dark overlay or a solid background behind the text, rather than relying on the photo.
Step 3: Fix Contrast in Controls and Icons
WCAG 1.4.11 asks for 3:1 for the parts of a control that you need to see to use it: input borders, checkbox outlines, toggle tracks, icon buttons and the focus ring. Pale gray input borders are a frequent failure. Darken the border, or give the field a visible background, and make sure the focus indicator stands out against both the control and the page.
Step 4: Do Not Rely on Color Alone
Contrast is not the only color rule. WCAG 1.4.1 says color cannot be the only way information is shown. Links inside a paragraph need an underline or another visual cue besides color, and error fields need an icon or text, not just a red border.
Step 5: Check Dark Mode and Every Theme
Dark themes fail contrast as often as light ones, usually with mid-gray text on dark gray. Test each theme separately and keep separate tokens for each.
Step 6: Retest
Run the accessibility audit again and confirm the color contrast findings are gone. When you fix color contrast through design tokens instead of one element at a time, the fix carries over to every page and every new component. Contrast is often the most frequent finding in an audit, so it is a quick win for compliance with the European Accessibility Act and the ADA. For a wider view of testing, see the accessibility testing guide.