Skip to content
XUtilHub

Color Contrast and Accessibility: A Practical WCAG Guide

XUtilHub Team ·

Light gray text on a white background looks elegant in a design mock-up and is a struggle to read on a phone in sunlight. Contrast is the single most common accessibility failure on the web, and also one of the easiest to fix.

What WCAG requires

The Web Content Accessibility Guidelines (WCAG) measure contrast as a ratio from 1:1 (no contrast) to 21:1 (black on white).

ContentLevel AALevel AAA
Normal text4.5:17:1
Large text (24 px, or 18.66 px bold)3:14.5:1
Icons, form borders, focus outlines3:1–

Level AA is the usual target, and the one most accessibility laws and policies point to.

Why gray text fails so often

Text on whiteRatioAA normal text?
#00000021:1Pass
#33333312.6:1Pass
#7676764.5:1Pass (just)
#9999992.8:1Fail
#cccccc1.6:1Fail

#767676 is about the lightest gray that passes on pure white. Designers often reach for #999 or lighter for "subtle" text, captions and placeholders, and that's where most failures come from.

Brand colors that fail

Bright brand colors often fail with white text. Orange buttons are a classic: white on #f97316 is only about 2.8:1. Common fixes:

  • Darken the button a few shades until white text passes.
  • Use dark text on the bright color instead of white.
  • Keep the bright color for large shapes, icons and accents, and use a darker shade for text.

How to fix colors without losing your brand

  1. Check the pair in the contrast checker.
  2. If it fails, use one of the suggested fixes: the checker keeps your hue and adjusts only lightness until the pair passes.
  3. Build a full scale of your brand color with the shades generator, then use darker steps (600–800) for text and lighter ones (50–100) for backgrounds.

Don't rely on color alone

About 1 in 12 men has some form of color vision deficiency, most often red–green. A form that marks errors only with red borders, or a chart with red and green lines, can be unreadable for them. Add icons, labels, patterns or underlines, and preview your design with the color blindness simulator.

Quick checklist

  • Body text at least 4.5:1 against its background.
  • Placeholder text, captions and disabled-looking text checked too.
  • Buttons: text on the button and the button against the page.
  • Focus outlines visible (3:1).
  • Links distinguishable without color, or with enough contrast against surrounding text.
  • Text over images has an overlay or shadow to keep contrast.

Tools mentioned in this article

← All articles