WCAG 2.1 Contrast Ratios at a Glance
Strong text and border contrast makes interfaces readable on phones in sunlight and for people with low vision. WCAG 2.1 checks relative luminance contrast using (L1 + 0.05) / (L2 + 0.05):
- Normal body text (< 18pt / 24px): AA requires 4.5 : 1, AAA requires 7.0 : 1.
- Large text (≥ 18pt or ≥ 14pt bold): AA requires 3.0 : 1, AAA requires 4.5 : 1.
- UI borders, icons & focus rings: AA requires 3.0 : 1.
Why Full Precision Matters
A common bug in contrast widgets is rounding 4.4997 (for example, #5a2309 on #23abb4) up to 4.50 and showing a false "PASS" badge. Automated audits evaluate the exact unrounded ratio. This tool always compares full floating-point precision, displays 4 floored decimal digits, and clears previous scores immediately whenever either color input is invalid.
Limits
OKLCH inputs outside the standard sRGB gamut are clamped channel-by-channel to sRGB for HEX/RGB output and WCAG 2.1 relative luminance calculation. Translucent foreground colors are composited over the background color before computing luminance.