Contrast Checker
Evaluate color combinations for WCAG 2.1 compliance. Features real-time UI simulation, color blindness testing, and automated contrast correction for accessible web design.
About
In digital product design, accessibility is a fundamental requirement, not an optional enhancement. The Web Content Accessibility Guidelines (WCAG) 2.1 mandate specific contrast ratios between text and background colors to ensure content remains legible for users with visual impairments, including low vision and color blindness. Failure to meet these standards can result in poor user experience, reduced conversion rates, and legal liability under regulations like the ADA (Americans with Disabilities Act) and Section 508.
This tool goes beyond simple pass/fail metrics. It simulates how your color palette appears on actual user interface components (buttons, cards, inputs) and visualizes the experience through the lens of various vision deficiencies (Protanopia, Deuteranopia). By calculating relative luminance using the precise W3C algorithms, it provides mathematical certainty for your design system's compliance. We also include an intelligent "Smart Fix" algorithm that mathematically determines the nearest compliant color shade, saving hours of manual trial and error.
Formulas
The WCAG 2.1 contrast ratio is calculated using relative luminance (L). The formula compares the luminance of the lighter color (L1) against the darker color (L2):
To find luminance, RGB values (0-255) are first linearized to remove gamma correction. For a color component C (where C is R, G, or B divided by 255):
The total relative luminance is a weighted sum representing human eye sensitivity:
Reference Data
| Compliance Level | Min Ratio | Context & Use Case | Visual Impact |
|---|---|---|---|
| WCAG AA (Regular) | 4.5:1 | Body text (size < 18pt). Standard for nearly all web text. | Readable for users with 20/40 vision loss. |
| WCAG AA (Large) | 3.0:1 | Headlines ≥ 18pt (24px) or Bold ≥ 14pt (18.5px). | Acceptable for large UI elements. |
| WCAG AA (UI) | 3.0:1 | Input borders, icons, focus states, and charts. | Ensures functional elements are visible. |
| WCAG AAA (Regular) | 7.0:1 | High-priority text. Required for government/public sector. | Readable for users with 20/80 vision loss. |
| WCAG AAA (Large) | 4.5:1 | Large headings in strict compliance environments. | Maximum accessibility standard. |
| Incidental | N/A | Disabled buttons, decorative logos, invisible elements. | No contrast requirement. |
| Pure Black/White | 21.0:1 | Maximum theoretical contrast. | High visibility, potentially harsh on eyes. |
| Low Contrast | < 3.0:1 | Fails all text standards. | Invisible to many users; legally risky. |