Skip to main content

What is color contrast ratio and how to test it?

Color contrast ratio measures the luminance difference between text and background-higher ratios are easier to read. WCAG specifies minimum ratios: 4.5:1 for body text, 3:1 for large text (18pt or 14pt bold). These ensure readability for users with visual impairments.

Testing tools: WebAIM Contrast Checker-enter hex codes, see pass/fail. Contrast app (Mac)-pick colors from anywhere on screen. Chrome DevTools-inspect element shows contrast in Accessibility panel. Figma/Sketch plugins-check during design. Most tools show the ratio and whether it passes AA or AAA standards.

Check contrast for every text/background combination. Body copy, headers, button text, link text-each needs sufficient contrast. Light gray on white is a common fail. Dark mode can break carefully chosen contrasts. Test early in design, not just before send.