How to Check Color Contrast (WCAG)

How to Check Color Contrast (WCAG)

Gray text on a white background is the most common accessibility failure on the web — and the easiest to fix. All it takes is measuring the contrast ratio.

The numbers you need

WCAG (the Web Content Accessibility Guidelines) defines two thresholds:

Ratio Requirement Applies to
4.5:1 AA normal text Body text, links, form labels
3:1 AA large text Text over 24px (or 18.66px bold), UI icons

“AA” is the level most sites aim for; “AAA” (7:1) is stricter and rarely required.

Why 4.5:1

Contrast ratio measures how much a text color’s luminance differs from its background. At 4.5:1, people with mild-to-moderate vision loss can still read the text in most conditions. Below it, you’re betting your readers have perfect eyesight and a good screen — two bad bets.

Testing in seconds

  1. Grab the two colors (text and background) in HEX — use the color picker if you’re sampling from a screenshot.
  2. Paste them into the contrast checker.
  3. Read the ratio: 4.5+ for normal text, 3+ for large text.

If it fails, don’t redesign — just adjust. Darken the text or lighten the background until the ratio clears. Small nudges usually do it.

The stubborn cases

  • Placeholder text: applies too, and fails constantly. Darken it.
  • Text on images: measure against the actual pixels behind the text, or add a subtle overlay.
  • Brand colors: your logo’s contrast is a design choice; body text’s contrast is an obligation.

Five minutes of checking beats a wave of users silently bouncing off your site.