Colour contrast and accessibility: what the ratios mean
Contrast is the difference in brightness between text and its background. Low contrast is hard to read for many people, including those with low vision, and for everyone in bright sunlight.
The numbers to remember
| Use | Level AA | Level AAA |
|---|---|---|
| Normal text | 4.5 : 1 | 7 : 1 |
| Large text (about 18 pt, or 14 pt bold) | 3 : 1 | 4.5 : 1 |
| Icons and input borders | 3 : 1 | n/a |
How the ratio is calculated
(L1 + 0.05) ÷ (L2 + 0.05)
L1 is the relative luminance of the lighter colour and L2 of the darker one, each on a scale from 0 (black) to 1 (white). Black on white is the maximum, 21 : 1. The same colour on itself is 1 : 1.
Quick fixes
- Darken the text or lighten the background until the check passes.
- Be careful with text over images or gradients. Test the worst spot.
- Grey on white is the classic failure. Light greys often fall below 4.5 : 1.
Do not rely on colour alone
About 1 in 12 men and 1 in 200 women have some form of colour vision deficiency. Do not use colour as the only signal, for example red for errors. Add an icon, text or pattern too.
Passing the numbers does not guarantee a good design, but failing them almost always means a problem.
Try it nowThese tools run in your browser, so nothing is uploaded.
Colour Contrast CheckerHEX to RGB ConverterCSS Gradient Generator