Remediation guide
How to Fix Color Contrast Issues
Color contrast failures are the single most common finding in automated accessibility scans — appearing in an estimated 80% of audited sites. WCAG 1.4.3 requires a minimum 4.5:1 contrast ratio for normal-sized text and 3:1 for large text. This guide explains what the ratios mean, how to measure them, and how to fix the most common failures developers introduce.
- WCAG criteria
- Ratio requirements
- How to measure
- Common failures
- Fix patterns
- Exceptions
- Verify with ShipSafe
- FAQ
The WCAG success criteria
Three success criteria in WCAG 2.x cover color contrast. The two AA criteria are legally relevant in ADA and EN 301 549 compliance contexts.
1.4.3 Contrast (Minimum)
Text and images of text must have a contrast ratio of at least 4.5:1 against their background. Large text (18pt / 24px+ at normal weight, or 14pt / ~18.67px+ bold) needs only 3:1. Part of WCAG 2.0; required for AA conformance.
1.4.11 Non-text Contrast
The visual presentation of UI components (button borders, checkbox outlines, form field borders) and graphical objects (icons, chart lines) must have a 3:1 contrast ratio against adjacent colors. Added in WCAG 2.1.
1.4.6 Contrast (Enhanced)
The stricter AAA level: 7:1 for normal text, 4.5:1 for large text. Required only if you are targeting AAA conformance. Most legal and enterprise requirements stop at AA.
Ratio requirements at a glance
The required ratio depends on the text size and weight. Here is the full breakdown:
| Text type | Definition | WCAG AA (1.4.3) | WCAG AAA (1.4.6) |
|---|---|---|---|
| Normal text | Under 18pt (24px) at any weight; under 14pt (~18.67px) if bold | 4.5:1 | 7:1 |
| Large text — normal weight | 18pt (24px) or larger at regular weight | 3:1 | 4.5:1 |
| Large text — bold | 14pt (~18.67px) or larger at bold weight (700+) | 3:1 | 4.5:1 |
| UI component borders | Button outlines, form field borders, checkbox boundaries (1.4.11) | 3:1 | N/A |
| Graphical objects | Informational icons, chart data marks, focus indicators (1.4.11) | 3:1 | N/A |
font-weight: 400 qualifies as large text (≥ 24px? No — 20px < 24px). A 20px heading at font-weight: 700 qualifies as large bold text (≥ ~18.67px bold). Practically: body text at typical sizes (14–16px) is almost always “normal text” requiring 4.5:1.
How to measure contrast ratio
You have several reliable options, all free:
- Chrome / Edge DevTools color picker Open DevTools → Elements panel → Styles tab → click any color swatch. The color picker that opens shows the contrast ratio against the computed background color of that element. A “✓ AA” badge confirms the foreground/background pair passes 1.4.3. This works for any element with a computed color, including inherited text color.
- Firefox Accessibility Inspector Open DevTools → Accessibility tab → click any element. The right panel shows “Contrast” with the actual computed ratio and pass/fail for AA and AAA. Firefox resolves computed backgrounds across stacking layers, making it reliable for text on gradient or image backgrounds.
- Axe DevTools browser extension Run an accessibility scan from the Axe DevTools panel. It reports all 1.4.3 and 1.4.11 failures on the rendered page, including dynamically applied colors and CSS-variable–resolved colors. Each finding shows the failing element, the computed ratio, and the minimum required. Free tier covers most use cases.
- WebAIM Contrast Checker (web tool) Enter foreground and background hex values manually. Instantly shows the ratio and pass/fail for AA normal, AA large, and AAA. Useful for checking a specific color pair from a design file or CSS variable before it is deployed.
- ShipSafe (automated URL scan) Run ShipSafe on your page URL. The Accessibility section flags contrast-related patterns detectable from the HTML source, including inline styles and common low-contrast tokens. For comprehensive contrast coverage across all rendered styles, pair with Axe DevTools.
Common failures
These are the patterns developers introduce most often. Each creates an automatic WCAG 1.4.3 or 1.4.11 failure.
Gray body text on white
Design systems often use a mid-gray like #999, #9e9e9e, or rgba(0,0,0,.4) for secondary text. These all fail at normal body size.
The minimum passing gray on a white background is #767676 (ratio 4.54:1).
Placeholder text in form inputs
Browser default placeholder styling is typically around #A9A9A9 — a contrast ratio of about 1.5:1 on a white field. This fails badly, and unlike disabled states, placeholder text is not exempt from WCAG 1.4.3.
Fix with ::placeholder: input::placeholder { color: #767676; }
Light-colored ghost buttons
A button with a light outline and matching label — e.g., #90CAF9 (light blue) text and border on white — may look on-brand but fails both 1.4.3 (text) and 1.4.11 (button border). Ratio: approximately 1.6:1.
Fix by darkening both the border and label color together, or switching to a filled button style on light backgrounds.
White text on medium-tone backgrounds
White text on a mid-blue or mid-green button is a common design choice that often narrowly fails. #fff on #4CAF50 (Material green 500) gives a ratio of 2.86:1 — below the 3:1 large-text threshold and far below the 4.5:1 normal-text threshold.
Move to a darker shade of the same hue: #2E7D32 (green 800) gives white text a ratio of 8.59:1.
Low-contrast form field borders
WCAG 1.4.11 requires the visible border of an enabled input to achieve 3:1 against the background. A light gray border like #D1D5DB on white gives a ratio of 1.6:1 — a 1.4.11 failure even though the input text itself passes.
Use a border of at least #767676 on white, or rely on a focused state with a clearly visible outline that passes 3:1.
Link color blending into body text
Links must be distinguishable from surrounding text either by contrast ratio or by a non-color indicator (underline). A color: #4A90E2 link in #333333 body text achieves only about 1.4:1 against that text — a 1.4.3 failure if the underline is removed.
Keep the underline, or use a link color that achieves both 4.5:1 against the page background and 3:1 against the surrounding body text.
CSS fix patterns
These patterns address the most common failures without requiring a full design overhaul.
Fix placeholder text
The ::placeholder pseudo-element targets the placeholder text across all browsers. Set it to a color that achieves 4.5:1 on the field background color.
/* Minimum passing gray on a white input field */
input::placeholder,
textarea::placeholder {
color: #767676;
opacity: 1; /* Firefox reduces opacity by default */
}
/* On a light-gray field background (#F3F4F6 ≈ 1.4:1 from white) */
.search-field::placeholder {
color: #595959; /* 7.0:1 on #F3F4F6 */
opacity: 1;
}
Darken a gray text token without changing hue
If your design system defines text colors as CSS custom properties, adjust the value until the contrast passes. Use HSL to stay within the same hue family.
:root {
/* Before: #9CA3AF on white = 2.56:1 FAIL */
--text-muted: #9CA3AF;
/* After: #6B7280 on white = 5.74:1 PASS */
--text-muted: #6B7280;
}
/* Body text should use --text-primary, not --text-muted, at normal sizes.
Reserve --text-muted for captions, metadata, and large supporting text. */
Fix a low-contrast button
When white text does not reach 4.5:1 on the button background, darken the background color using HSL lightness. This preserves the brand hue.
/* Before: white text on #60A0D0 (blue) = 3.08:1 — passes for large
bold text only; fails for normal-size button labels */
.btn-primary {
background: #60A0D0;
color: #ffffff;
}
/* After: darken lightness from 60% to 44% — ratio becomes 4.6:1 */
.btn-primary {
background: #3a7cb0; /* same hue/sat, lower lightness */
color: #ffffff;
}
/* Alternative: switch to dark text on the original light background */
.btn-secondary {
background: #60A0D0;
color: #1a3f5c; /* 7.9:1 — passes AA and AAA */
}
Fix a low-contrast form field border (WCAG 1.4.11)
The visible border of an enabled input must achieve 3:1 against the adjacent background. Add a focus ring that passes 3:1 against the page background (also satisfying 2.4.7 and 2.4.11).
/* Before: barely-visible light border fails 1.4.11 */
input[type="text"] {
border: 1px solid #D1D5DB; /* 1.6:1 on white — FAIL */
}
/* After: mid-gray border passes 1.4.11 */
input[type="text"] {
border: 1px solid #767676; /* 4.54:1 on white — PASS */
}
/* Focus ring: visible indicator, 3:1 non-text contrast */
input[type="text"]:focus-visible {
outline: 2px solid #2563EB; /* 5.9:1 on white */
outline-offset: 1px;
}
Fix icon contrast (WCAG 1.4.11)
An informational icon (one that conveys meaning without adjacent text) must achieve 3:1 against its background. Decorative icons that have no functional meaning are exempt.
/* Warning icon — informational, must pass 1.4.11 */
.icon-warning {
/* Before: #FCD34D (yellow) on white = 1.49:1 FAIL */
color: #FCD34D;
/* After: #B45309 (amber-700) on white = 5.74:1 PASS */
color: #B45309;
}
/* Decorative flourish — no information conveyed, exempt */
.icon-decorative {
color: #FCD34D; /* contrast irrelevant if aria-hidden="true"
and no text alternative references it */
aria-hidden: true; /* set in HTML, not CSS — shown here as a reminder */
}
Exceptions: when low contrast is allowed
WCAG 1.4.3 lists four explicit exceptions where the ratio requirement does not apply:
| Exception | What qualifies | What does NOT qualify |
|---|---|---|
| Inactive UI components | Disabled buttons, disabled form fields — users are not expected to read or interact with them | Read-only inputs; placeholder text; dimmed-but-enabled elements |
| Incidental / decorative text | Text in a background image with no functional meaning; purely decorative letterforms | Any text a user reads to understand content, navigation, or instructions |
| Logotypes | Text that is part of a logo or brand name | Taglines, navigation labels, or other body copy near a logo |
| Text in an image of text | Photographs containing incidental text (e.g., a street sign in the background of a photo) | Images of text used to convey page content; text in infographics |
Verify with ShipSafe
After applying contrast fixes, run ShipSafe on your URL. The Accessibility section surfaces color-related patterns detectable from the HTML source. For comprehensive contrast coverage across all computed and dynamically applied styles, combine ShipSafe with the Axe DevTools browser extension or Chrome DevTools Lighthouse Accessibility audit — both inspect the full rendered DOM with computed CSS values and flag every 1.4.3 and 1.4.11 failure.
When you re-audit, look for zero contrast-related findings across all three: ShipSafe (structural patterns), Axe (rendered DOM), and a manual check of your brand color palette against the actual page backgrounds before shipping.
Related ShipSafe guides:
- ADA compliance checklist for developers — 30 testable WCAG 2.1 AA items
- WCAG remediation checklist for existing websites
- How to fix missing alt text on images — WCAG 1.1.1
- How to test keyboard navigation accessibility — WCAG 2.1.1
Frequently asked questions
What contrast ratio is required by WCAG?
WCAG 1.4.3 at Level AA requires 4.5:1 for normal-sized text and 3:1 for large text. Large text is 18pt (24px) or larger at normal weight, or 14pt (~18.67px) or larger at bold weight. WCAG 1.4.11 requires 3:1 for UI component visual indicators (button borders, form field outlines) and informational graphical objects (icons, chart marks). The Level AAA requirement (1.4.6) is 7:1 for normal text and 4.5:1 for large text.
What is the minimum gray text color that passes WCAG on a white background?
For normal-weight body text on #FFFFFF, the minimum passing gray is #767676 (contrast ratio 4.54:1). Common design values like #999999 (2.85:1), #9CA3AF (2.56:1), and #A0A0A0 (2.32:1) all fail. For large text (18pt+ normal or 14pt+ bold), the minimum passing gray is approximately #949494 (3.03:1). Check any specific pair with the WebAIM Contrast Checker or Chrome DevTools color picker.
Are disabled elements exempt from WCAG color contrast?
Yes. WCAG 1.4.3 explicitly exempts inactive UI components — a disabled button with low-contrast text does not create a WCAG failure. The rationale is that users are not expected to read or operate disabled controls to complete a task. However, placeholder text in an enabled input is not exempt — it must meet 4.5:1. Read-only inputs that display content a user reads are also not exempt.
Does WCAG color contrast apply to placeholder text?
Yes. Placeholder text is content the user reads to understand what to enter — it is not an inactive UI component. Browser default placeholder styling (~#A9A9A9) achieves approximately 1.5:1 on a white field, which fails badly. Fix with: input::placeholder { color: #767676; opacity: 1; }. The opacity: 1 is needed because Firefox reduces placeholder opacity by default, lowering the effective contrast.
What does WCAG 1.4.11 Non-text Contrast cover?
WCAG 1.4.11 (Level AA, introduced in WCAG 2.1) requires 3:1 contrast for: (1) UI components — the visual boundary that identifies an interactive element, such as the border of a text input, the outer edge of a checkbox, or the fill of a button; and (2) Graphical objects — icon shapes, chart data marks, and other visuals that convey information. It does not apply to disabled components or purely decorative graphics (aria-hidden="true").
How do I check color contrast without installing a plugin?
Chrome and Edge DevTools have a built-in contrast checker: open DevTools → Elements → Styles, click any color swatch, and the picker shows the contrast ratio with a pass/fail for AA. Firefox DevTools Accessibility Inspector shows the computed contrast ratio for any selected element. For a full page audit without a plugin, use Chrome DevTools Lighthouse (Audits → Accessibility) which runs an axe-core scan on the rendered page.
Does ShipSafe check color contrast?
ShipSafe scans the page HTML source for color contrast patterns detectable from markup and inline styles. For comprehensive coverage across all rendered styles — CSS custom properties, dynamically applied classes, computed backgrounds — combine ShipSafe with the Axe DevTools browser extension or Chrome DevTools Lighthouse Accessibility audit. These tools inspect the fully rendered DOM and flag every 1.4.3 and 1.4.11 failure with the computed ratio.
Also in the Copper Bay Labs suite
Color contrast is one dimension of ADA and WCAG risk. These free tools cover the rest:
Generate a privacy policy, terms of service, and cookie notice for your site — free, in your browser, no account.
Security headers HardenCheckScan your live site’s HTTP headers for missing CSP, HSTS, and other security hardening flags.
Secret scanning LeakCheckPaste code or a config file and see exposed API keys and secrets flagged before they reach the repo.
Post-deploy ExposureCheckScan your live URL for exposed .env files, .git directories, source maps, and bundled secrets.