Color Contrast and Accessibility: WCAG Explained Simply
Contrast is the difference in brightness between text and its background. Too little, and people with low vision, older users or anyone looking at a phone in the sun will struggle to read. The Web Content Accessibility Guidelines (WCAG) give clear numbers to aim for.
The contrast ratio
WCAG measures contrast as a ratio from 1:1 (no difference, such as white on white) to 21:1 (black on white). The ratio compares the relative luminance of the two colors, which is how bright they appear to the human eye, not how saturated they are. That is why yellow text on white fails even though yellow looks "strong".
The thresholds
- Normal text, level AA: at least 4.5:1.
- Large text, level AA: at least 3:1. Large means at least 18 points (about 24 pixels), or 14 points bold (about 18.7 pixels).
- Normal text, level AAA: at least 7:1.
- Large text, level AAA: at least 4.5:1.
- Icons, input borders and other interface parts: at least 3:1 against the colors next to them (added in WCAG 2.1).
Level AA is the usual target and the level referenced by most accessibility laws and policies. Logos and purely decorative elements have no contrast requirement.
Do not rely on color alone
About 8% of men and 0.5% of women of Northern European descent have a red-green color vision deficiency. If an error is shown only by turning a border red, some people will not notice it. Add an icon, a text message or an underline as well. You can preview your palette with simulated color blindness in our generator.
How to fix a color that fails
- Make the text darker or the background lighter (or the opposite in dark mode). Changing lightness matters much more than changing hue.
- Keep your brand color for large elements, and use a darker shade of it for small text and links.
- Use our contrast checker: it suggests the closest color that passes AA.
What about WCAG 3 and APCA?
A newer contrast method called APCA is being explored for a future version of the guidelines. It better reflects how font size and weight affect readability. For now, the WCAG 2 ratios above remain the standard to follow.