All Guides
Accessibility

Fix Color Contrast

Meet WCAG contrast requirements so everyone can read your text.

What this covers: Meet WCAG contrast requirements so everyone can read your text, including minimum wcag contrast ratios, quick checks.

Who it’s for: Site owners and developers who need to meet accessibility standards and avoid legal risk.

Key outcome: You’ll have all body text meets wcag aa minimum: 4.5:1 contrast ratio against its background, and large text (18px+ bold or 24px+ regular) meets the 3:1 minimum contrast ratio.

Time to read: 5 minutes

Part of: Accessibility series

Your text is too light. WCAG requires specific contrast ratios: 4.5:1 for body text, 3:1 for large text. Here’s how to check yours and fix what fails.

Minimum WCAG Contrast Ratios

WCAG 2.1 Level AA requires:

  • Normal text: 4.5:1 contrast ratio minimum
  • Large text (18px+ bold or 24px+ regular): 3:1 minimum
  • UI components and graphics: 3:1 minimum

Level AAA (enhanced) requires 7:1 for normal text—harder to achieve but better for everyone.

Quick Checks

What Passes (4.5:1+)

  • #000000 on #FFFFFF ? 21:1 ? (maximum possible)
  • #333333 on #FFFFFF ? 12.6:1 ?
  • #595959 on #FFFFFF ? 7:1 ? (AAA compliant)
  • #767676 on #FFFFFF ? 4.5:1 ? (AA minimum)

What Fails

  • #999999 on #FFFFFF ? 2.8:1 ? (common “light gray” failure)
  • #AAAAAA on #FFFFFF ? 2.3:1 ?
  • Placeholder text in light gray ? usually fails

Testing Tools

Pick the tool that fits your workflow and budget.

Common Failures

1. Placeholder Text

That light gray “Enter your email” placeholder? Probably fails. Either darken it or add a visible label.

2. Disabled Buttons

Grayed-out buttons often fail contrast. That’s technically allowed by WCAG (disabled elements are exempt), but consider whether users understand the button is disabled.

3. Text Over Images

White text on a photo works in some spots, fails in others. Solutions:

  • Add a dark overlay behind text
  • Add a text shadow
  • Use a solid background behind the text

4. Brand Colors

“But our brand yellow is #FFD700!” Then don’t use it on white backgrounds for text. Use it for large graphics where 3:1 is acceptable, or darken it for text use.

The Fix Pattern

  1. Run contrast checker on every text/background combo
  2. Fix anything below 4.5:1 by darkening text or lightening background
  3. Check hover and focus states too
  4. Check dark mode if you have one

Edge Cases That Tools Miss

Automated checkers catch static text-on-background pairs, but several failure patterns slip through.

Dark-on-dark interfaces: Dark mode designs often pair #333 text on #1a1a1a backgrounds—technically above 3:1 for large text, but unreadable in bright environments. Test dark themes at daytime screen brightness, not in a dim room.

Text over gradients: A heading that passes contrast against the left side of a gradient may fail against the right side. Check the lowest-contrast point, not the average. CSS overlay with rgba(0,0,0,0.5) is more reliable than hoping the gradient stays dark enough.

Hover and focus states: A link that passes at rest may fail on hover if you lighten it. Focus rings that use your brand color need 3:1 against both the element background and the page background. Check every interactive state, not just the default.

Semi-transparent text: Text using opacity or rgba colors reduces effective contrast. A pure white heading at opacity: 0.7 on a white background drops well below passing. Compute the flattened color before checking the ratio.

Practical walkthrough: In Chrome DevTools, inspect any text element, click the color swatch in the Styles panel, and the contrast ratio appears with a pass/fail indicator. Expand it to see both AA and AAA thresholds. For bulk checking, run the axe DevTools extension—it flags every failing element with a CSS selector you can search for directly.

Confirming Contrast Ratios Pass

  • Text contrast ratio is at least 4.5:1 (WCAG AA)
  • UI components have 3:1 contrast against background
  • Color is not the only way information is conveyed
  • Automated tools (WAVE, axe) show no contrast errors

Sources

Color Contrast Questions Answered

What color contrast ratio does WCAG require?

WCAG 2.1 AA requires 4.5:1 for normal text (under 18px) and 3:1 for large text (18px+ bold or 24px+ regular). Level AAA requires 7:1 for normal text and 4.5:1 for large text. Most legal requirements reference AA, not AAA.

How do I check my site”s color contrast?

Use the WebAIM Contrast Checker (webaim.org/resources/contrastchecker) for individual color pairs. For a full-site audit, use the WAVE browser extension or axe DevTools, which flag all contrast failures on a page. Chrome DevTools also shows contrast ratios in the color picker.

Does color contrast apply to images and icons?

WCAG requires 3:1 contrast for meaningful non-text elements like icons, chart lines, and form input borders. Images of text must meet the same 4.5:1 ratio as live text. Decorative images are exempt. Infographics and data visualizations should not rely on color alone to convey information.

What about light text on light backgrounds in my design?

Low-contrast “aesthetic” designs fail accessibility requirements and hurt readability for everyone, not just users with visual impairments. Gray text on white backgrounds is the most common failure. If your brand uses light colors, increase text weight or darken the text color until the 4.5:1 ratio is met.

✓ Your Color Contrast Meets WCAG Standards When

  • All body text meets WCAG AA minimum: 4.5:1 contrast ratio against its background
  • Large text (18px+ bold or 24px+ regular) meets the 3:1 minimum contrast ratio
  • UI components and graphical objects (icons, form borders, focus rings) have at least 3:1 contrast
  • Text over images or gradients maintains contrast — verified with a color picker on the darkest/lightest overlap areas
  • WAVE or axe DevTools reports zero contrast errors across all page templates

Test it: Run the WAVE browser extension on every page template — the contrast tab should show zero errors, and spot-check 3 text/background combos with the WebAIM Contrast Checker.