How to use the contrast checker (wcag)
- Set the text color with the picker or by typing a code.
- Set the background color.
- Read the ratio and the pass or fail table.
- If it fails, press Use it to apply the closest passing color.
What the ratio means
The contrast ratio compares the brightness of two colors, from 1:1 (identical) to 21:1 (black on white). The Web Content Accessibility Guidelines (WCAG) set minimum ratios so that people with low vision or color blindness, and anyone reading a phone in sunlight, can still read your text.
| Level | Normal text | Large text | Icons and controls |
|---|---|---|---|
| AA (the usual legal and design standard) | 4.5:1 | 3:1 | 3:1 |
| AAA (enhanced) | 7:1 | 4.5:1 | not defined |
Large text means 18 pt (24 px) or larger, or 14 pt (about 19 px) and bold.
Common mistakes
- Light gray text on white.
#999999on white is only 2.8:1. Use#767676or darker to reach 4.5:1. - White text on bright colors. White on yellow, lime, orange or sky blue almost always fails. Use dark text on those backgrounds.
- Text over photos. Contrast changes across the image. Add a dark overlay or a solid panel behind the words.
- Placeholder text. Hint text inside form fields must meet the same ratio as other text.
- Relying on color alone. A red error message also needs an icon or words, because some users cannot tell red from green.
Who benefits
About 1 in 12 men and 1 in 200 women have some form of color vision deficiency, and far more people have reduced contrast sensitivity as they age. Good contrast also makes pages easier for everyone to read on a dim or glare-covered screen.