WCAG Color Contrast Ratio Checker

Check WCAG 2.1 AA/AAA accessibility contrast ratios between text and background colors.

Overview

Evaluates the luminance contrast ratio between foreground text and background colors according to Web Content Accessibility Guidelines (WCAG 2.1).

Formula & Calculation Method

Contrast Ratio = (L1 + 0.05) / (L2 + 0.05) where L1 is relative luminance of lighter color and L2 is darker color

Checks compliance against WCAG Level AA (minimum 4.5:1 for normal text, 3:1 for large text) and Level AAA (minimum 7:1 for normal text).

Worked Example: Evaluating Dark Slate Text (#0f172a) on Light Gray Background (#f8fafc)

Inputs: Foreground = #0f172a | Background = #f8fafc

  • Calculate relative luminance L1 and L2.
  • Ratio = (0.95 + 0.05) / (0.02 + 0.05) = 1.00 / 0.07 = 14.28:1
  • Threshold comparison: Exceeds 4.5:1 (AA) and 7.0:1 (AAA).

Summary: Contrast Ratio = 14.3:1 | WCAG AA: PASS | WCAG AAA: PASS (Accessible)

Common Use Cases

  • Accessibility Compliance: Ensure web user interfaces comply with legal Americans with Disabilities Act (ADA) and WCAG standards.
  • Design System Auditing: Audit button text, input labels, and alert banners for accessible readability.
  • Dark Mode Optimization: Validate inverted color palettes to prevent low-contrast gray-on-dark eye fatigue.

Frequently Asked Questions

What is the minimum WCAG contrast ratio for normal text?

WCAG 2.1 Level AA requires a minimum contrast ratio of 4.5:1 for regular body text, and 3:1 for large text (18pt or 14pt bold).

What is the AAA contrast standard?

WCAG Level AAA requires a stricter 7:1 ratio for normal text and 4.5:1 for large text, representing highest accessibility.

Do placeholder texts inside inputs need to meet contrast ratios?

Yes, low-contrast placeholder text is one of the most common accessibility failures flagged by automated audit tools.

Related Calculators & Tools