Designio

Color contrast and WCAG, explained without the jargon

Contrast is the difference in brightness between two colors. Low contrast makes text tiring for everyone and unreadable for some people, including many with low vision. WCAG, the main web accessibility guideline, turns this into numbers you can test.

The numbers to remember

Ratios run from 1:1 to 21:1. These are the ones that matter most:

  • 4.5:1 for normal text at level AA
  • 3:1 for large text at level AA, meaning 24px or more, or about 18.7px bold
  • 3:1 for icons, input borders and other parts of the interface
  • 7:1 for normal text at the stricter level AAA

Common failures

The classic failure is light gray text on white. For example, #9CA3AF on white scores about 2.5:1. Placeholder text, disabled-looking captions and pale link colors are other frequent problems. White text on bright yellow, orange or light green buttons also tends to fail.

How to fix a failing color

Change the lightness and keep the hue. Darkening the gray to #6B7280 brings it to about 4.8:1 and it still reads as gray. For buttons, try dark text instead of white on bright colors.

Beyond the score

Passing the formula is a floor, not a guarantee. Thin weights and small sizes can still be hard to read. Never use color as the only signal either: add an icon or a word to error messages so that color-blind visitors get the same information.

Keep reading