Color Contrast Checker

Verify WCAG 2.1 Level AA (4.5:1) and Level AAA (7.0:1) text and UI contrast ratios while simultaneously auditing perceived contrast under Deuteranopia, Protanopia, Tritanopia, and Monochromacy.

WCAG 2.1 AA/AAA + Protanopia & Deuteranopia Ratio Audit

Accessible Heading Preview (22px Bold)

Body text preview (16px regular): WCAG 2.1 Level AA requires a contrast ratio of at least 4.5:1 for normal text and 3.0:1 for large text or UI components. Level AAA requires 7.0:1.

A color contrast checker measures the relative luminance ratio between foreground text (or UI icons) and its background surface to verify compliance with the Web Content Accessibility Guidelines (WCAG 2.1 and WCAG 2.2). However, standard contrast calculators only test normal trichromatic luminance—ignoring how Protanopia (red-blindness), Deuteranopia (green-blindness), and Tritanopia (blue-yellow blindness) shift perceived brightness and hue contrast. Our dual-engine color contrast checker evaluates both official W3C WCAG AA/AAA ratios and real-time simulated contrast ratios across all major types of color blindness.

Spectrum Luminance and Contrast Comparison Across Color Vision Deficiencies

WCAG 2.1 & 2.2 Contrast Ratio Requirements (AA vs. AAA)

The World Wide Web Consortium (W3C) defines strict minimum luminance contrast thresholds under Success Criterion 1.4.3 (Contrast Minimum — Level AA), Success Criterion 1.4.6 (Contrast Enhanced — Level AAA), and Success Criterion 1.4.11 (Non-Text Contrast — Level AA). Contrast ratios range from 1 : 1 (invisible white text on a white background) to 21 : 1 (pure black #000000 on pure white #FFFFFF):

Content Element Type Font Size & Weight Definition WCAG Level AA Minimum WCAG Level AAA Enhanced
Normal Body Text Under 18pt (24px) regular, or under 14pt (18.66px) bold (700) 4.5 : 1 7.0 : 1
Large-Scale Heading Text At least 18pt (24px) regular, or at least 14pt (18.66px) bold (700) 3.0 : 1 4.5 : 1
UI Components & Graphical Objects Input borders, button outlines, focus rings, chart bars, and status icons 3.0 : 1 4.5 : 1 (Recommended)
Incidental / Disabled Elements Inactive disabled buttons, decorative placeholders, and brand logos Exempt (No minimum) Exempt

How Relative Luminance & Contrast Ratios Are Calculated

Under the official W3C WCAG 2.x formula, our color contrast checker first converts 8-bit sRGB channels ($R_{8bit}, G_{8bit}, B_{8bit} \in [0, 255]$) into linearized RGB values ($R, G, B$) and computes relative luminance ($L$):

  • Relative Luminance Formula: $L = 0.2126 \times R + 0.7152 \times G + 0.0722 \times B$
  • Contrast Ratio Formula: $\text{Ratio} = (L_{\text{lighter}} + 0.05) / (L_{\text{darker}} + 0.05)$

Notice that green light contributes 71.52% of human photopic luminance, red contributes 21.26%, and blue contributes only 7.22%. This physiological weighting explains why a color contrast checker must also account for Color Vision Deficiency:

  1. The Protanopia Red-Darkening Trap: When a person has Protanopia (missing 560 nm L-cones), long-wavelength red light cannot stimulate their retina normally. A vibrant red error label (#EF4444) on a dark charcoal card (#18181B) registers a 4.56 : 1 (AA Pass) in a conventional calculator—yet inside a Protanopia simulation, #EF4444 darkens to #8E6E24, dropping the effective perceived contrast and making the error unreadable.
  2. Simultaneous Hue + Luminance Testing: By checking the four bottom cards in our color contrast checker (Deuteranopia Ratio, Protanopia Ratio, Tritanopia Ratio, and Monochromacy Ratio), you ensure your typography and buttons pass both legal WCAG audits and real-world colorblind usability.

How to Fix Low-Contrast Colors Without Breaking Your Brand Aesthetic

When a brand palette fails in the color contrast checker, follow this systematic remediation workflow:

  • Adjust Lightness in HSL/OKLCH Before Changing Hue: If your primary blue button (#3B82F6 with white #FFFFFF text gives 3.68 : 1, failing Normal Text AA), keep the exact same hue angle (217°) and darken the lightness by 8–10% to #2563EB (5.17 : 1, passing AA) or #1D4ED8 (6.70 : 1).
  • Use Tinted Surface Backgrounds Instead of Pure Gray: Pairing dark slate text (#0F172A) with a very light cool surface (#F6F8FB) yields a crisp 17.4 : 1 contrast ratio (passing AAA) while avoiding the harsh glare of pure #000000 on #FFFFFF.
  • Pair High Contrast with Colorblind-Safe Palettes: For multi-color badges, tags, and data visualizations, pull pre-verified swatches from our colorblind colors studio and preview full-page screenshots inside our homepage colorblind simulator. To understand how contrast interacts with daily visual tasks, read what do colorblind people see.

Frequently Asked Questions

What is a passing score in a WCAG color contrast checker?

For WCAG 2.1 Level AA compliance, normal body text (under 24px regular or 18.66px bold) requires a minimum contrast ratio of 4.5:1 against its background. Large text (24px+ regular or 18.66px+ bold) and interactive UI components/icons require at least 3.0:1. Level AAA requires 7.0:1 for normal text and 4.5:1 for large text.

Why does your color contrast checker also test Deuteranopia and Protanopia ratios?

Standard WCAG contrast formulas assume normal L-cone (red) and M-cone (green) sensitivity. However, in Protanopia (red-blindness), red wavelengths appear up to 60% darker than normal. Testing your foreground and background Hex pair across Deuteranopia, Protanopia, and Tritanopia guarantees that red or green text stays legible for colorblind users.

Do icons, buttons, and chart bars need to pass the color contrast checker?

Yes. Under WCAG 2.1 Success Criterion 1.4.11 (Non-Text Contrast), active user interface components (such as input borders, checkboxes, toggle switches, and focus indicators) and graphical objects required to understand content (such as pie chart slices and line graphs) must maintain at least a 3.0:1 contrast ratio against adjacent colors.

How do I make red error and green success messages pass the contrast checker?

Swap pure red (#EF4444) and green (#22C55E) pairings for high-contrast Blue (#1D4ED8) and Amber/Orange (#D97706), or pair dark semantic text (#991B1B for error, #166534 for success) on soft pastel pill backgrounds (#FEE2E2 and #DCFCE7) so both combinations exceed 7.0:1 AAA luminance contrast even in grayscale.

Comments: 0

Accessibility Feedback & Questions

Share how you use this tool in your design workflow, accessibility audit, or classroom.