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
| Element | WCAG AA | WCAG AAA |
|---|---|---|
| Normal text (under 18pt or under 14pt bold) | 4.5:1 | 7:1 |
| Large text (18pt+ or 14pt+ bold) | 3:1 | 4.5:1 |
| UI components & graphics | 3:1 | — |
| Decorative content | No requirement | No requirement |
| Logos & brand | Exempt | Exempt |
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
- Pick text and background pairs early, check ratios with a tool, lock them into design tokens.
- Establish a "minimum text color" — the lightest gray that passes AA on your background.
- Test interactive states (hover, focus, active, disabled) for contrast too.
- Run automated audits (axe, Lighthouse, WAVE) on every page before shipping.
- 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 →