Calculate WCAG contrast ratio between two colours and check AA and AAA.
The 0.05 offset models ambient screen reflection, which is why pure black on pure white gives 21:1 rather than an infinite ratio. Large text needs less contrast because its strokes are thicker. Contrast failures are the single most common accessibility defect on the web, and unlike most they are fully determined by the design tokens rather than the implementation.
Accessibility Contrast
Contrast = (L_lighter + 0.05) ÷ (L_darker + 0.05)
Contrast = (L_lighter + 0.05) ÷ (L_darker + 0.05) The 0.05 offset models ambient screen reflection, which is why pure black on pure white gives 21:1 rather than an infinite ratio. Large text needs less contrast because its strokes are thicker.
Contrast failures are the single most common accessibility defect on the web, and unlike most they are fully determined by the design tokens rather than the implementation.
This calculator takes 3 inputs: Foreground relative luminance, Background relative luminance, Text size. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.