How contrast is measured
The WCAG contrast ratio compares the relative brightness (luminance) of two colors. It ranges from 1:1 (identical) to 21:1 (pure black on pure white). Each color's relative luminance is computed by linearizing its red, green and blue channels and weighting them by how the eye perceives each:
where L is relative luminance. The 0.05 terms account for ambient screen glare. Because the ratio uses perceived brightness, two colors that look different can still have poor contrast if their luminances are close.
Worked example
Slate text #475569 on white #ffffff:
WCAG thresholds
The Web Content Accessibility Guidelines set minimums: AA requires 4.5:1 for normal text and 3:1 for large text (18pt, or 14pt bold). The stricter AAA level requires 7:1 for normal and 4.5:1 for large text. The checker shows pass/fail badges for each combination so you can tell at a glance whether your color pair is accessible — and the live preview lets you sanity-check it with your own eyes.