WCAG Contrast Checker
Check the contrast ratio between a text color and a background color, with pass/fail results for every WCAG 2 level — instantly, in your browser.
Check the contrast ratio between a text color and a background color, with pass/fail results for every WCAG 2 level. Enter two HEX colors below — the result updates instantly, entirely in your browser.
Formula
The exact W3C WCAG 2 formula: relative luminance is computed per channel (c ≤ 0.03928 ? c/12.92 : ((c+0.055)/1.055)^2.4, applied to each of R/G/B), combined as L = 0.2126R + 0.7152G + 0.0722B. Contrast ratio is (L1 + 0.05) / (L2 + 0.05), lighter color first.
Worked example: pure black (#000000) on pure white (#FFFFFF) gives the maximum possible ratio, 21:1.
WCAG 2 pass thresholds: AA normal text needs 4.5:1, AA large text needs 3:1, AAA normal text needs 7:1, AAA large text needs 4.5:1.
FAQs
What counts as “large text” for WCAG?
WCAG defines large text as 18pt (24px) or larger, or 14pt (18.66px) bold or larger — everything else is “normal text” and needs the stricter ratio.