Color Contrast Checker (WCAG)
Check foreground/background contrast and see WCAG AA/AAA results for normal and large text.
How to Use
- Paste or type your text into the Color Contrast Checker (WCAG) input area above.
- Configure any format or mode options to generate the result in real time.
- Click Copy to copy the formatted result to your clipboard, or Reset to clear the workbench.
What is Color Contrast Checker (WCAG)?
A WCAG color contrast checker evaluates the relative luminance contrast ratio between foreground text and background colors against W3C WCAG 2.1 AA and AAA accessibility thresholds. Front-end developers, UX designers, and accessibility auditors use it to ensure body copy and headings remain legible for users with low vision or color-vision deficiency.
How It Works
After you enter Foreground and Background HEX colors and click Check Contrast, contrastRatioHex() linearizes sRGB channels (gamma threshold 0.03928, power 2.4), computes relative luminance L = 0.2126R + 0.7152G + 0.0722B, and returns (L_lighter + 0.05) / (L_darker + 0.05). evaluateWcag() checks AA normal (≥4.5), AA large (≥3.0), AAA normal (≥7.0), and AAA large (≥4.5), rendering four scaled text previews and an accessible foreground suggestion if contrast fails 4.5:1.
Common Use Cases
- Design system token audits — validate every text-on-surface CSS token pair against WCAG AA 4.5:1 and AAA 7.0:1 gates
- Large heading verification — test whether hero display headings pass the 3.0:1 AA large-text criterion (≥18pt or 14pt bold)
- Quick contrast remediation — click Suggest accessible foreground when ratio < 4.5 to test black/white fallback contrast
- Accessibility compliance reports — copy the formatted ratio and PASS/FAIL breakdown into QA tickets
Technical Details
Implements W3C WCAG 2.1 relative luminance (gamma cutoff 0.03928, exponent 2.4) and contrast ratio (1:1–21:1) via contrastRatioHex() and evaluateWcag(). Renders live previews at 28px, 18px, 16px, and 13px.
FAQ
Is this Color Contrast Checker (WCAG) free?
Yes, completely free. No signup required.
Does this tool upload my data?
No. All processing happens locally in your browser. Your data never leaves your device.