What the contrast ratio means
The Web Content Accessibility Guidelines (WCAG), published by the W3C, measure how readable text is against its background with a contrast ratio: the relative luminance of the lighter colour plus 0.05, divided by that of the darker one plus 0.05. It runs from 1:1 (the same colour) to 21:1 (black on white). Relative luminance is a colour's brightness as the eye sees it, which is why yellow looks far lighter than blue at the same strength.
| What | AA | AAA |
|---|---|---|
| Normal text | 4.5:1 (1.4.3) | 7:1 (1.4.6) |
| Large text: 18 pt, or 14 pt bold | 3:1 (1.4.3) | 4.5:1 (1.4.6) |
| Icons, input borders and other graphics | 3:1 (1.4.11) | No AAA level |
On screens, 18 pt is 24 pixels and 14 pt is about 18.67 pixels, the sizes the checker's preview uses. Level AA is the level the US rule below points to; AAA is stricter.
Why the ratio isn't rounded
The W3C's guidance says computed values should not be rounded: 4.499:1 does not meet 4.5:1. So the checker passes or fails a pair on the exact ratio, and shows it cut (not rounded) to two decimals. Mid grey #777777 on white comes to 4.47:1 and fails AA for normal text; #767676, one step darker, comes to 4.54:1 and passes.
Fixing a pair that fails
When a pair falls short, the checker offers the nearest text colour and the nearest background colour that reach AA or AAA. It keeps the colour's hue and saturation and moves only its lightness, in the OKLCH colour space, lighter or darker, whichever changes the colour less. So a brand orange that fails becomes a deeper orange that passes, not a different colour.
- Change the text first. A darker text colour on a light background is usually less noticeable than a new background.
- Check every pair you use: body text, links, buttons, placeholder text and text on coloured panels.
- Text over a photo has no single background colour. Check it against the lightest and the darkest parts, or put the text on a solid panel.
- See-through text is checked as it looks over the background, since that is the colour a reader sees.
Building a set of colours? The color palette generator shows how readable white and black text are on each colour. Here, the two colours are kept in the page's address, so you can send the pair you checked to a colleague or keep the link with your design notes.
Contrast and accessibility rules
In the United States, the Department of Justice's rule for state and local governments sets WCAG 2.1 Level AA as the standard for their websites and mobile apps; an interim final rule published in April 2026 moved the compliance dates to April 26, 2027 for larger governments and April 26, 2028 for smaller ones and special districts. For businesses open to the public, the Department's web guidance says the ADA applies but there is no regulation with detailed standards, and it names colour contrast in text among the things to get right.
In the European Union, the European Accessibility Act covers products and services such as e-commerce, banking services and e-books, alongside computers, phones and ticketing machines. What it asks of a given product or service is set by the Act and the national laws that carry it out, so check the rules for yours. A contrast check is one step towards them.
Updated