AccessibilityApril 2026 ยท 7 min read

How to Check Color Contrast for WCAG Compliance

Color contrast is the difference in luminance between foreground text and its background. WCAG (Web Content Accessibility Guidelines) sets minimum contrast ratios to ensure text is readable for people with low vision or color deficiencies. Failing contrast means real users can't read your content.

๐Ÿ‘๏ธ
Try the Contrast Checker
Free, no signup
โ†’
DG
Derek Giordano
Designer & Developer
In this guide
01WCAG AA vs AAA Contrast Requirements02How Contrast Ratios Are Calculated03Common Contrast Failures04How to Fix Low Contrast05Testing Workflow
โšก Key Takeaways
  • Test your color combinations against WCAG 2.
  • Covers wcag aa vs aaa contrast requirements.
  • How Contrast Ratios Are Calculated.
  • Covers common contrast failures.
  • How to Fix Low Contrast.

WCAG AA vs AAA Contrast Requirements

WCAG defines two compliance levels. AA is the minimum standard required by most accessibility laws: 4.5:1 for normal text (under 18px/14px bold) and 3:1 for large text (18px+ or 14px+ bold). AAA is the enhanced standard: 7:1 for normal text and 4.5:1 for large text. Most organizations target AA. AAA is recommended for critical content like body text on healthcare or government sites. UI components and graphical objects require a minimum 3:1 contrast ratio against adjacent colors.

How Contrast Ratios Are Calculated

The contrast ratio is calculated from the relative luminance of two colors. Relative luminance measures a color's brightness on a scale from 0 (black) to 1 (white), weighted for human perception โ€” green contributes more to perceived brightness than red, which contributes more than blue. The formula is (L1 + 0.05) / (L2 + 0.05) where L1 is the lighter color's luminance and L2 is the darker. The result ranges from 1:1 (identical colors) to 21:1 (black on white). You don't need to calculate this manually โ€” the Contrast Checker tool does it instantly.

๐Ÿ’ก Tip
Use 3+ color stops instead of 2 to avoid the muddy gray band that appears in the center of complementary-color gradients.

Common Contrast Failures

Light gray text on white backgrounds is the most frequent failure โ€” designers love the aesthetic, but #999 on #FFF only achieves 2.85:1 (fails AA). You need at least #767676 on white for AA compliance. Other common failures include colored text on colored backgrounds (blue on purple, orange on yellow), placeholder text in form inputs (often set too light), and text over images without a background overlay. Buttons with white text on bright brand colors also frequently fail.

โš  Warning
CSS gradients used as backgrounds cannot be animated with standard transitions. Use background-size animation or @property registered custom properties instead.

How to Fix Low Contrast

When a color pair fails, you have three options: darken the text color, lighten the background, or add a semi-transparent overlay between text and a background image. Adjust the lighter color first โ€” small changes to a light color have a bigger impact on contrast than the same adjustment to a dark color. For text over images, add a dark overlay (rgba(0,0,0,0.5) or higher) behind the text. The Contrast Checker shows the exact ratio as you adjust colors, so you can find the minimum change needed to pass.

Testing Workflow

Check contrast during design, not after development. In Figma, use a contrast plugin on every text layer. For existing sites, run a full-page audit with browser DevTools (Chrome's CSS Overview captures every text/background pair). Then use the Contrast Checker for specific pairs you need to adjust. Test both light and dark modes โ€” a color pair that passes in light mode often fails in dark mode because the background/foreground relationship inverts.

Frequently Asked Questions

What contrast ratio does WCAG AA require?+
WCAG AA requires 4.5:1 for normal text and 3:1 for large text (18px or larger, or 14px bold or larger). UI components and icons require 3:1 against adjacent colors.
What is the minimum contrast for AAA?+
WCAG AAA requires 7:1 for normal text and 4.5:1 for large text. AAA is a higher standard than AA and is recommended for critical content.
Does contrast ratio apply to images?+
WCAG contrast requirements apply to text and meaningful icons, not to photographs. However, text placed over images must meet contrast requirements against the image area behind it โ€” which usually means adding a background overlay.
Try it yourself

Use the Contrast Checker โ€” free, no signup required.

โšก Open Contrast Checker
DG
Derek Giordano
Written by the creator of Ultimate Design Tools. BA in Business Marketing.