Accessibility Contrast: A Complete Guide

Contrast is one aspect of accessibility. This guide explains WCAG contrast criteria and practical checks; passing a contrast check alone does not establish accessibility or legal compliance.

The WCAG Requirements

ElementWCAG AAWCAG AAA
Normal text (under 18pt or under 14pt bold)4.5:17:1
Large text (18pt+ or 14pt+ bold)3:14.5:1
UI components & graphics3:1—
Decorative contentNo requirementNo requirement
Logos & brandExemptExempt

How Contrast Is Measured

WCAG contrast uses relative luminance — a perceptual measure of how light or dark a color appears. The formula:

Contrast = (L_lighter + 0.05) / (L_darker + 0.05)

Relative luminance is computed from linearized RGB values. The contrast ratio ranges from 1:1 (equal luminance, not necessarily identical colors) to 21:1 (black and white). Hue difference alone does not establish sufficient contrast.

Common Failures

  • Light gray on white. #999 on white is 2.85:1 — fails AA. #767676 is the minimum that passes AA (4.54:1).
  • Placeholder text. Often styled at very low contrast; treat as required content and apply AA rules.
  • Buttons on bright colors. White text on yellow or light blue typically fails. Test before shipping.
  • Disabled states. WCAG technically exempts disabled elements, but readable disabled states improve UX. Aim for 3:1.
  • Focus indicators. Provide a visible keyboard focus style. WCAG non-text contrast and Focus Appearance have different scopes, exceptions and conformance levels; check the applicable criterion rather than assuming one contrast ratio covers every focus design.
  • Color-only signals. Red text alone for errors fails users with color blindness. Always pair with icon or label.

A Reliable Workflow

  1. Pick text and background pairs early, check ratios with a tool, lock them into design tokens.
  2. Establish a "minimum text color" — the lightest gray that passes AA on your background.
  3. Test interactive states (hover, focus, active, disabled) for contrast too.
  4. Run automated audits (axe, Lighthouse, WAVE) on every page before shipping.
  5. Test with real low-vision users or contrast simulators for nuanced issues.

Quick-Reference Targets

When you just need the numbers to hit, these are the thresholds worth memorising:

  • 4.5:1 — normal body text at AA. The everyday minimum for paragraphs, labels and links.
  • 3:1 applies to large text at AA: at least 24 CSS pixels regular or about 18.67 CSS pixels bold. WCAG 1.4.11 also requires 3:1 for visual information needed to identify interface components, states and graphical objects, with exceptions; not every border, icon or focus style is covered in the same way.
  • 7:1 / 4.5:1 — AAA for normal and large text; aim here for long-form reading or low-vision audiences.
  • For opaque 8-bit sRGB neutral grays on white, #767676 is the lightest integer-channel gray that meets 4.5:1. Transparency, compositing and other color spaces require evaluating the final rendered colors.

Remember that contrast is about luminance, not hue: two vivid colours can clash yet still fail, so always check the measured ratio rather than trusting your eye.

Try It Yourself

Extract a palette and verify contrast across all color pairs with DesignKit's color tools.

Color Palette Extractor →

Frequently Asked Questions

WCAG contrast compares relative luminance from 1:1 to 21:1. A higher ratio is not a universal measure of readability, which also depends on typography, layout and user needs.
AA text thresholds generally use 4.5:1 for normal text and 3:1 for large text; AAA uses 7:1 and 4.5:1, with criterion-specific exceptions. Applicable legal obligations depend on jurisdiction and context; this guide is not legal advice.
(L_lighter + 0.05) / (L_darker + 0.05), where L is relative luminance from gamma-corrected RGB.
WCAG 1.4.11 generally requires 3:1 against adjacent colors for visual information needed to identify covered controls, states and graphical objects. Exceptions include inactive components, unmodified user-agent controls and graphics whose particular presentation is essential.
Light gray on white, placeholder text, white on bright buttons, color-only error indicators.