What does a contrast ratio measure between any two colors?
A contrast ratio compares the brightness of two colors, usually text and its background. The scale runs from 1:1, where both colors match, to 21:1, which is black on white. Thus, the higher the number, the easier the text is to read.
Importantly, ratios are calculated from the colors themselves, not from one screen. That makes each contrast ratio a fair and repeatable test. For example, a free contrast checker shows the ratio of two colors at once.
Testing your main text, link and button colors takes a few minutes, so run a contrast ratio test early. First, start with body text, because it covers most of every page. Then move on to links, buttons and labels, which are often missed. These WCAG AAA contrast checks rarely take an hour.
How does WCAG AAA contrast compare with the AA level?
WCAG defines levels A, AA and AAA. For text, the two levels that matter are AA and AAA. The WCAG AAA contrast levels are set out below.
- Level AA asks for at least 4.5:1 on normal text and 3:1 on large text.
- Level AAA asks for at least 7:1 on normal text and 4.5:1 on large text.
AA is the level most organizations aim for. In contrast, AAA asks for a higher margin. As a result, a color that shifts slightly in a new campaign still stays well above the minimum. The WCAG AAA contrast margin is a buffer for later changes.
What counts as large text under the WCAG rules today?
Why do big letters get a lower target in WCAG?
Large text gets a lower target, because bigger letters are easier to read. Each large text rule below uses the same scale.
In WCAG, large text means at least 18 point, or 14 point if bold. On most websites, that is roughly 24 pixels regular or 18.7 pixels bold. Headings often qualify, while body text usually does not. So the WCAG AAA contrast target for body text stays at 7:1.
In particular, be careful with light, thin fonts. A large heading in a very light weight can still be hard to read. That holds even when it counts as large text on paper. So when in doubt, test it, and choose heavier weights for colored headings.
Where do pages usually fail the WCAG AAA contrast test?
A few places fail contrast checks again and again. Hint text inside form fields is often pale grey. Similarly, footer text is often small and faint.
Besides, links in body text are sometimes colored but not dark enough. Also, text over photos changes contrast from one part of the image to another. In stores, price labels in light brand colors are common failures.
Check these places first, since fixing them often brings a site close to AAA. The WCAG AAA contrast failures above are cheap to find and cheap to fix.
Text over images deserves extra care as well. Specifically, a dark overlay or a solid band of color keeps the ratio stable whatever the photo shows.
How should you test the buttons, icons and form borders?
Contrast is not only about text. WCAG 2.2 also asks for non-text contrast of at least 3:1 on parts of controls. One example is the border of an input field.
The same non-text contrast rule applies to icons needed to understand content. Notably, this is an AA requirement.
A pale grey border on a white form field often fails non-text contrast. Consequently, the field becomes hard to find. Still, text inside buttons follows the text rules.
For instance, white text on a mid-blue button may pass AA and fail AAA.
Darkening the button slightly is usually enough to pass both levels. Each non-text contrast check works the same way. Also, check non-text contrast on focus outlines.
How can you keep brand colors and still reach AAA?
In practice, most brands can reach enhanced contrast without changing their identity. The trick is to give each color in the brand palette one clear role.
Logos and brand names are exempt from contrast rules in WCAG. Therefore, the logo can stay exactly as it is, while the rest of the page stays readable.
It helps to write your brand palette rules down. Note which shades are allowed for text, which for buttons and which only for decoration. Next, share the note with anyone who creates content. In that way, a brand palette guide with WCAG AAA contrast notes keeps new pages consistent.