← Back to Accessalyze

By Genesis AI Services · April 21, 2026 · 7 min read · WCAG 2.1

WCAG Color Contrast Requirements Explained

The rule: Normal text needs a 4.5:1 contrast ratio against its background. Large text (18px+ regular or 14px+ bold) needs 3:1. UI components need 3:1. These come from WCAG success criteria 1.4.3 and 1.4.11.

Color contrast failures are the single most common WCAG violation — present on roughly 83% of audited websites according to the WebAIM Million report. Most of these are easy to fix once you understand the rules.

The Contrast Ratio Requirements

Content Type WCAG AA Ratio WCAG AAA Ratio Criterion
Normal text (under 18pt / under 14pt bold) 4.5:1 7:1 1.4.3
Large text (18pt+ / 14pt+ bold) 3:1 4.5:1 1.4.3
UI components (buttons, inputs, checkboxes) 3:1 1.4.11
Focus indicators 3:1 1.4.11
Decorative text (no meaning) Exempt Exempt
Logos and brand text Exempt Exempt

Common Failing Color Combinations

These color pairs look fine to many designers but fail WCAG:

See how 321 websites scored →

View the 2026 Report
Foreground Background Ratio Normal Text
#767676 (gray) #ffffff (white) 4.54:1 PASS (barely)
#757575 (gray) #ffffff (white) 4.48:1 FAIL
#999999 #ffffff 2.85:1 FAIL
#0000ff (blue) #ffffff 8.59:1 PASS
#3b82f6 (Tailwind blue-500) #ffffff 3.35:1 FAIL (normal text)
#2563eb (Tailwind blue-600) #ffffff 5.08:1 PASS

How to Calculate a Contrast Ratio

The ratio is calculated from the relative luminance of the two colors:

Contrast ratio = (L1 + 0.05) / (L2 + 0.05)

Where L1 = lighter color luminance, L2 = darker color luminance.
Luminance = 0.2126*R + 0.7152*G + 0.0722*B
(each channel linearized from sRGB)

You don't need to do this math manually. Use these free tools:

Fixing Contrast Failures in CSS

Body text too light

/* FAIL — gray-400 on white is only 2.85:1 */
p { color: #9ca3af; }

/* PASS — gray-700 on white is 8.59:1 */
p { color: #374151; }

Blue links on white

/* FAIL — blue-500 on white is 3.35:1 */
a { color: #3b82f6; }

/* PASS — blue-700 on white is 7.27:1 */
a { color: #1d4ed8; }

Button text on colored background

/* FAIL — white text on green-400 is 2.7:1 */
.btn { background: #4ade80; color: #fff; }

/* PASS — white text on green-700 is 5.74:1 */
.btn { background: #15803d; color: #fff; }

Placeholder text in inputs

/* FAIL — #9ca3af placeholder on white is 2.85:1 */
::placeholder { color: #9ca3af; }

/* PASS — #6b7280 placeholder on white is 4.54:1 */
::placeholder { color: #6b7280; }

UI Component Contrast (WCAG 1.4.11)

Added in WCAG 2.1, this criterion requires that the visual boundary of UI components — the border of a text input, the outline of a checkbox, the border of a button — has at least 3:1 contrast against the adjacent background.

/* FAIL — light gray border on white */
input { border: 1px solid #d1d5db; }

/* PASS — darker border meets 3:1 against white */
input { border: 1px solid #6b7280; }

Focus Indicator Contrast

The focus ring around a focused element must also meet 3:1. Many sites use outline: none entirely — this is a WCAG 2.4.7 failure and also an 1.4.11 failure.

/* FAIL — removes focus ring entirely */
:focus { outline: none; }

/* PASS — custom high-contrast focus ring */
:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

Find All Your Contrast Failures Automatically

Accessalyze scans your live site and reports every color contrast violation with exact ratios and suggested fix colors.

Scan for Contrast Issues →

← Back to Accessalyze · Next: How to Fix Color Contrast Issues in CSS →

Accessalyze - Free WCAG 2.1 scanner that writes the fix code for you | Product Hunt

See real website accessibility scores: Browse 244+ free accessibility audits →

Try it yourself

Enter your website URL to get a free accessibility score.

Check your website accessibility score free Scan Now →