Fix text that falls below the minimum color contrast ratio
Elements must meet minimum color contrast ratio thresholds is the message for axe's color-contrast rule, and it means some text on the page is too close in brightness to the color behind it. WCAG 2.2 Level AA asks for a ratio of at least 4.5:1 for normal text and 3:1 for large text. For each element it flags, axe prints the ratio it measured, the two colors and the ratio it expected, so the fix is changing the text or background color until the number clears the line.
What the color contrast failure tells you
Measured ratio and colors
The contrast axe computed between the text and the background behind it, followed by both colors and the font size and weight it read from the page.
Expected ratio
4.5:1 for normal text, or 3:1 when the text counts as large: at least 18 point, or 14 point and bold. W3C puts those sizes at about 24px and 18.5px.
Needs review instead of a failure
When axe can't work out the background, such as behind a background image, a gradient or an overlapping element, it lists the text for review rather than failing it. A person has to measure those.
The failure and review messages are in axe-core's message list, and the thresholds and sizes are in W3C's Understanding Contrast (Minimum).
Which text the contrast rule covers
The 4.5:1 rule applies to visible text of every kind, including placeholder text, text that appears on hover or keyboard focus, and images of text. W3C's explanation lists what's exempt: text in a disabled control, pure decoration, text nobody can see, incidental text in a photo, and logos or brand names.
Ratios aren't rounded. W3C's own example is 4.499:1, which misses the 4.5:1 threshold, so a color pair that a tool rounds up to 4.5 can still fail.
A clean result doesn't clear everything either. Deque's rule page says the rule won't report failures on text with a CSS background image, text covered by another element or images of text. axe lists the first two for review and never checks images of text, so measure text over photos and gradients yourself at the lightest point behind it.
Common contrast failures and what to change
| Where it fails | What to change |
|---|---|
| Light gray body text, captions or footer links on white | Darken the color variable those elements share until it reaches 4.5:1 against the page background. One change at the source fixes every element that uses it. |
| Placeholder text in form fields | Darken it with the ::placeholder selector. If the placeholder is the only hint about what to type, move that hint into a visible label. |
| White text on a brand-colored button | Darken the button background or switch to dark text, and test the hover and focus colors too, since text shown in those states counts. |
| Text over a photo or gradient | Put a solid or semi-transparent layer behind the text, then measure the lightest spot under it by hand, since axe can only list text over a background image for review. |
| Text faded with opacity | Lowering opacity blends the text into whatever sits behind it, so the color in your stylesheet isn't the color on screen. Use a darker color at full opacity instead. |
How to fix a color contrast failure
- Open the element axe flaggedCopy the selector from the result and find the element in your browser's developer tools. The message names the two colors it compared, so you know whether the text or the background is the one to change.
- Change the color where it's definedEdit the shared color variable or design token rather than overriding one element. A one-off override fixes this element and leaves the same color failing elsewhere.
- Test each state and color schemeCheck hover, focus and visited styles, and the dark theme if your site has one. Every pairing of text and background is measured on its own.
- Run the rule againRerun axe on the same page and confirm the element has moved from violations to passes. Then measure anything it listed for review.
Frequently asked questions
Do disabled buttons need to meet color contrast?
No. W3C's explanation says components that aren't available for interaction, such as a disabled HTML control, have no contrast requirement, and Deque's rule page notes that axe skips the text inside disabled buttons.
How do I check contrast in Chrome DevTools?
Inspect the text, and the tooltip shows its contrast ratio, with a warning sign when it's low. Open the color picker beside the text color's declaration and expand Contrast ratio to see whether it meets AA or AAA, or apply the suggested color. Chrome's contrast guide also covers the CSS Overview panel, which gathers a page's contrast issues in one table.
How common is low contrast text?
It's the failure WebAIM finds most often. Its 2026 Million report, which tests the top million home pages with WAVE, found low contrast text on 83.9% of them, with 34 distinct instances on the average home page.
Keep working through the WCAG AA criteria
- Website accessibilityFind what stops people with disabilities from using your site.
- WCAG 2.2 AA checklistPlan the A and AA criteria review and identify the decisions that need a person.
- Fix the accessibility problems Lighthouse reportsFix the form label, link name, lang, heading order and ARIA warnings in Lighthouse.