Glossary term

Color Contrast

CMore terms under C

Color contrast is the difference in lightness between foreground and background colors. On a website, it helps determine whether text and other important details are easy to see.

Pale gray text on a white page may look quiet and restrained. It may also be difficult to read. Changing the typeface or making the letters sharper does not change the contrast between those two colors.

The same words, two color pairs

Text contrast on white
2.32:1#aaaaaa on #ffffff · fails AA text contrast
Your order is on its way.7.46:1#555555 on #ffffff · passes AA text contrast
Both samples use the same 18px regular text. The intentionally faint specimen is repeated in the darker sample.

The two samples use these CSS color pairs. The background stays white; only the text color changes.

.faint-text {
  color: #aaaaaa;
  background-color: #ffffff;
}

.readable-text {
  color: #555555;
  background-color: #ffffff;
}

For ordinary text, WCAG Level AA calls for a contrast ratio of at least 4.5:1. Qualifying large text needs at least 3:1: roughly 24 CSS pixels at regular weight, or about 18.7 CSS pixels in bold. The ratio compares relative luminance, not simply whether the colors have different names.

A blue link and gray paragraph can look different in hue while still being similarly light. Contrast also matters over photographs, gradients, and colored buttons, where the background behind the words can vary. A passing pair helps establish that particular text’s visibility; it does not establish that the whole page is accessible.

Frequently asked questions

How do you check color contrast for accessibility?

A contrast checker compares the foreground and background colors and reports their ratio. The meaningful pair is the one actually behind the text, including any transparency or image. The Fix Color Contrast guide covers the practical work.

Does larger text need as much contrast?

WCAG AA allows a lower minimum for qualifying large text because it is easier to distinguish. Small text does not qualify just because it is bold, and a large heading is not exempt from contrast requirements.

Put it into practice

Fix Color Contrast

Sources

← Browse Glossary: C