Color accessibility is one of the most concrete areas of web accessibility — the requirements are numeric, testable, and fixable without redesigning entire interfaces. Yet accessibility contrast failures remain common because designers often assess color combinations visually (it looks fine to me) rather than numerically (what is the actual ratio?). Understanding the math and building a testing habit into the workflow prevents accessibility issues from reaching production.
WCAG Contrast Requirements
The Web Content Accessibility Guidelines define minimum contrast ratios based on text size and use case:
| Element Type | WCAG AA Minimum | WCAG AAA Target |
|---|---|---|
| Normal text (under 18pt / 14pt bold) | 4.5:1 | 7:1 |
| Large text (18pt+ or 14pt+ bold) | 3:1 | 4.5:1 |
| UI components (button borders, inputs) | 3:1 | — |
| Graphical objects and icons | 3:1 | — |
| Focus indicators (keyboard navigation) | 3:1 | — |
The contrast ratio is calculated from the relative luminance of the two colors. Relative luminance converts an RGB color to a linear value representing how bright it appears to the human visual system — accounting for the fact that green contributes most to perceived brightness, followed by red, then blue. Pure white (1.0) vs pure black (0.0) gives the maximum ratio of 21:1.
Sample Any Color From Any Live Site
Color Pick Pro captures pixel-accurate HEX values to feed into your accessibility checker.
Add Color Pick Pro FreeCommon Contrast Failures
Light gray text on white
The most prevalent failure. Designers use light gray text to create visual hierarchy — secondary text, captions, metadata — but push it too light for compliance.
| Text Color | On White Background | Contrast Ratio | AA Pass? |
|---|---|---|---|
#6b7280 (gray-500) |
White (#fff) | 4.63:1 | PASS (barely) |
#9ca3af (gray-400) |
White (#fff) | 2.40:1 | FAIL |
#d1d5db (gray-300) |
White (#fff) | 1.38:1 | FAIL |
#374151 (gray-700) |
White (#fff) | 10.70:1 | PASS |
#4b5563 (gray-600) |
White (#fff) | 7.21:1 | PASS |
Practical rule: use gray-600 or darker for secondary text on white backgrounds. Avoid gray-400 and lighter for any readable text — reserve the lightest grays for purely decorative elements, not content.
White text on medium-saturation colors
White text on a medium-saturation colored background is a very common CTA and badge pattern. The contrast depends on the lightness of the background color — not just its hue.
| Background Color | White Text Ratio | AA Pass? |
|---|---|---|
#3b82f6 (blue-500) |
3.26:1 | FAIL (normal text) |
#2563eb (blue-600) |
4.78:1 | PASS |
#1d4ed8 (blue-700) |
7.62:1 | PASS (AAA) |
#ef4444 (red-500) |
3.16:1 | FAIL (normal text) |
#dc2626 (red-600) |
4.73:1 | PASS |
#16a34a (green-600) |
3.30:1 | FAIL |
#15803d (green-700) |
5.55:1 | PASS |
The pattern is clear: the "500" Tailwind shades (medium saturation) generally fail for white text at normal size. Use the "600" or "700" shades for white text backgrounds to reliably pass AA.
Input field placeholders and borders
Form inputs are frequently inaccessible. Two common issues:
- Placeholder text: Browsers default to about 40-50% opacity on placeholder text, which typically fails contrast requirements. Check your actual rendered placeholder contrast, not just the placeholder color value — opacity compounds the contrast issue.
- Input borders: Very light input borders against a white background (e.g.,
#e5e7ebon white) fail the 3:1 UI component threshold. Users who rely on the visible border to identify input fields — including users with low contrast sensitivity — may not perceive the field boundary.
Checking Contrast on Live Websites
The workflow for auditing an existing site's color accessibility:
- Open the live site in Chrome
- Activate Color Pick Pro and sample the body text color
- Note the HEX value
- Sample the background behind that text
- Note that HEX value
- Enter both at webaim.org/resources/contrastchecker
- The tool calculates the ratio and shows AA/AAA pass/fail
- Repeat for secondary text, links, button text on button backgrounds, and form placeholder text
Chrome DevTools also has an integrated contrast checker: Inspect any text element, click the color swatch in the Styles panel, and the color picker shows "Contrast ratio" with a pass/fail indicator. This is the fastest approach for checking individual elements.
Audit Any Site's Color Accessibility in Minutes
Sample each color with Color Pick Pro, then verify contrast ratios in the checker.
Install Color Pick Pro FreeBuilding Accessible Color Systems
Semantic color pairing
Rather than choosing colors independently and hoping they pass, design accessible color pairs from the start. For each foreground/background combination in your system, verify the contrast at design time:
- Body text on page background — must be 4.5:1+
- Secondary text on page background — must be 4.5:1+
- Link color on page background — must be 4.5:1+
- Primary button text on primary button background — must be 4.5:1+
- Error text on error background — must be 4.5:1+
- Badge text on badge background — must be 4.5:1+
Don't use color alone
Approximately 8% of men and 0.5% of women have some form of color vision deficiency. The most common — red-green color blindness — means red error states and green success states look identical. Accessible design adds a secondary indicator: an error icon, underline, or label in addition to the red color. Color reinforces meaning; it shouldn't be the only carrier of meaning.
Focus indicator contrast
Keyboard navigation accessibility requires visible focus indicators — the outline that shows which element is focused when tabbing through a page. Many designs suppress the default browser focus ring (outline: none) without providing an accessible replacement. A visible focus indicator must have 3:1 contrast against adjacent colors to pass WCAG 2.1 Success Criterion 2.4.7.
Frequently Asked Questions
What is the WCAG contrast ratio requirement for accessible text?
WCAG 2.1 Level AA requires 4.5:1 for normal text (under 18pt or 14pt bold) and 3:1 for large text. UI components and icons also need 3:1. Level AAA targets are 7:1 for normal text and 4.5:1 for large text. Most compliance targets are Level AA. Pure black on white achieves 21:1 — the maximum possible ratio.
How do I check if my color combination passes WCAG contrast requirements?
Use Color Pick Pro to sample both the text color and its background from your live design or site. Enter both HEX values at webaim.org/resources/contrastchecker to get the calculated ratio and pass/fail result. Chrome DevTools also shows contrast ratios in the element inspector — inspect the text element, click the color swatch in the Styles panel, and look for the Contrast ratio line.
What are the most common color accessibility mistakes in web design?
Light gray text on white backgrounds (gray-400 and lighter fail), white text on medium-saturation color backgrounds (most 500-shade colors fail), extremely light placeholder text in form inputs, using color alone to indicate error/success states, and suppressing focus indicators without accessible replacements. The gray-on-white and white-on-color failures account for the majority of accessibility audit findings on typical commercial websites.
How do I make my brand color pass WCAG contrast requirements?
If the brand color fails as text on white: use it as a background with white text instead (if the brand color is dark enough), create a darker shade of the brand color specifically for text use, or reserve the brand color for large text and UI components where only 3:1 is required. Test your brand color at all its intended uses — the same color may pass for large headings but fail for small body text.
Does color contrast matter for UI components and icons, not just text?
Yes — WCAG 2.1 requires 3:1 for UI components (button borders, input borders, checkbox states), graphical objects (icons, charts), and focus indicators. Common failures include very light input field borders against white form backgrounds, light-gray icons on light backgrounds, and subtle focus rings. The 3:1 threshold is less strict than text (4.5:1) but still requires meaningful visible contrast.