Color Contrast and Accessibility: A Practical Guide
How to make sure your colors meet WCAG accessibility standards. Contrast ratios, AA vs AAA, and tools to get it right — explained without the jargon.
You pick a color that looks great on your monitor. Ship it. Then someone tells you they can't read the text.
This happens more than you'd think. About 1 in 12 men and 1 in 200 women have some form of color vision deficiency. Add in low-contrast screens, bright sunlight, and aging eyes, and suddenly your color choices affect a lot of people.
The good news: there are clear rules for this. They're called WCAG contrast requirements, and they're simpler than they sound.
What's a Contrast Ratio?
A contrast ratio is a number that describes how much two colors differ in brightness. It ranges from 1:1 (no contrast — same color) to 21:1 (maximum contrast — black on white).
Your eyes don't see all color differences equally. A contrast ratio accounts for how human vision actually perceives lightness, not just the mathematical color difference.
Here's a quick reference:
| Contrast Ratio | How It Looks | Passes? | |---|---|---| | 1:1 – 2:1 | Nearly invisible | No | | 3:1 | Readable but straining | AA for large text only | | 4.5:1 | Comfortable reading | AA for normal text | | 7:1 | Very clear | AAA for normal text | | 21:1 | Maximum (black on white) | Everything |
AA vs. AAA: What's the Difference?
WCAG defines two conformance levels that matter for color:
Level AA (the standard most sites aim for):
- Normal text (under 18pt): needs 4.5:1 contrast ratio
- Large text (18pt+ or 14pt+ bold): needs 3:1 contrast ratio
- UI components and graphical objects: needs 3:1 contrast ratio
Level AAA (the gold standard):
- Normal text: needs 7:1 contrast ratio
- Large text: needs 4.5:1 contrast ratio
Most organizations target AA. AAA is ideal but can be restrictive for design — not many color combinations hit 7:1 while still looking good.
Common Contrast Failures
These come up all the time in real projects:
Light gray text on white backgrounds: That subtle, "elegant" gray text? Often fails contrast. #999999 on white is only 2.85:1 — it fails even for large text.
Colored text on colored backgrounds: Blue on purple, green on blue, red on dark gray. They might look distinct to you but fall short on contrast ratios.
Placeholder text in forms: Light gray placeholder text is almost universal in web design, and it almost always fails contrast requirements. Users with low vision can't read what's expected in the field.
Text over images: Unless you add a dark overlay or text shadow, text on photos rarely meets contrast standards consistently.
Color Blindness Considerations
Contrast ratios help, but they don't solve everything. Color blindness means some users literally cannot distinguish between certain color pairs.
Don't rely on color alone to convey information:
- Red/green for error/success? Add icons or text labels too
- Color-coded charts? Add patterns, labels, or different shapes
- Required fields marked only in red? Add an asterisk or "(required)" text
The most common types:
- Deuteranopia (red-green, ~6% of men): Red and green look similar
- Protanopia (red-green, ~2% of men): Red appears dark/brownish
- Tritanopia (blue-yellow, rare): Blue and yellow are hard to distinguish
Practical Steps to Fix Your Colors
Step 1: Convert your brand colors to hex using a color converter. You need exact values to check contrast.
Step 2: Test every text/background combination. Don't just check your primary text — check buttons, links, captions, form labels, error messages.
Step 3: Fix failures by adjusting lightness. Usually you can keep the same hue and saturation while darkening or lightening to hit the ratio.
Step 4: Test with simulators. Chrome DevTools has a built-in vision deficiency simulator (Rendering panel > Emulate vision deficiencies).
Step 5: Check your SVG graphics and images too. Icons with poor contrast are just as problematic as text.
Quick Wins
If you're in a hurry, these safe combinations always work for AA:
- Black (
#000000) on white (#FFFFFF) — 21:1 - Dark gray (
#333333) on white — 12.6:1 - White text on dark blue (
#003366) — 9.9:1 - Black text on light yellow (
#FFF9C4) — 18.1:1 - Dark green (
#2E7D32) on white — 5.1:1
And these commonly fail:
- Medium gray (
#808080) on white — 3.9:1 (fails AA normal text) - Red (
#FF0000) on black — 5.25:1 (passes AA but fails AAA) - Orange (
#FF8C00) on white — 3.0:1 (fails AA normal text)
Accessibility isn't just compliance — it's making sure everyone can actually use what you build. Start by checking your text contrast ratios. Fix the obvious failures first. Then work your way through buttons, icons, and secondary text. Small changes, big impact.