Contrast Ratio Calculator
Find the WCAG contrast ratio between two luminances.
Contrast ratio measures how distinguishable two colors are, key for accessible design.
The math behind it
ratio = (lighter + 0.05) / (darker + 0.05) using relative luminance. WCAG wants 4.5:1 for normal text.
Worked example
Luminances 1 and 0.2 give a 4.2:1 ratio.
FAQ
What ratio passes WCAG AA?
4.5:1 for normal text, 3:1 for large text.