Contrast Ratio
The ratio between the luminance of foreground and background. WCAG AA asks 4.5:1 for normal text and 3:1 for large text.
See it on the 3D treeGoing deeper
In WCAG 2 it is calculated from relative luminance: the lighter value plus 0.05 divided by the darker plus 0.05, giving 1:1 to 21:1. Large text means at least 18 point, or 14 point bold. AAA asks more, and interface graphics have a 3:1 requirement. The formula is an imperfect model of perception.
Why it matters
It replaces judging by eye on your own screen with a number you can check and defend.
In practice
Pale grey helper text looks elegant on your monitor but measures below 4.5:1, so you darken it.
Common mistake
Rounding a near miss such as 4.49:1 up and treating it as a pass.
Connected terms
- WCAGWCAG sets the minimum ratios and defines how they are calculated.
- Colour BlindnessStrong lightness contrast helps colours stay distinct when hues merge.
- ContrastThe ratio measures one kind of contrast, the difference in luminance.
- Dark ModeText and controls must be measured again against the dark surfaces.
- LegibilityLow contrast makes characters harder to make out.
- NeumorphismWCAG expects 3:1 for visual information needed to identify controls and states.
- Neutral ColoursText greys should be checked against their backgrounds.
- ValueDifferences in lightness, more than hue, drive the ratio.