Skip to main content
Beta: Front-End Checklist is currently in beta. Some issues are still being fixed. Thanks for your patience.

Meet minimum color contrast ratios

Text and background colors must have sufficient contrast to be readable by users with low vision or color blindness.

Utilities
Quick take
Typical fix time 15 min
  • Normal text (< 18pt or < 14pt bold): minimum contrast ratio of 4.5:1 — WCAG 2.1 SC 1.4.3 Level AA
  • Large text (≥ 18pt / 24px, or ≥ 14pt bold / ~18.67px bold): minimum 3:1 contrast ratio
  • Non-text UI components (icons, focus indicators, input borders): minimum 3:1 against adjacent color — WCAG 2.1 SC 1.4.11 Level AA
  • WCAG 2.1 SC 1.4.6 (Level AAA) requires 7:1 for normal text and 4.5:1 for large text
  • Decorative text and logotypes are exempt from contrast requirements
Why it matters: Approximately 1 in 12 men and 1 in 200 women have some form of color vision deficiency. Low contrast text is also difficult for users with low vision, aging eyesight, or those reading in bright sunlight. Insufficient contrast is one of the most common WCAG failures and directly prevents users from reading content they need.

Rule Details

Text must have sufficient contrast against its background to ensure it is readable by as many people as possible, including those with low vision or color vision deficiencies.

Code Example

/* ✅ Good: Dark text on white — 21:1 ratio */
.body-text {
  color: #000000;
  background-color: #ffffff;
}
 
/* ✅ Good: #595959 on white meets 4.5:1 for normal text */
.secondary-text {
  color: #595959;
  background-color: #ffffff;
}
 
/* ✅ Good: #767676 on white meets 3:1 — only valid for large text (≥ 24px or ≥ 18.67px bold) */
.large-heading {
  font-size: 1.5rem; /* 24px at 16px base */
  font-weight: bold;
  color: #767676;
  background-color: #ffffff;
}
 
/* ❌ Fail: #cccccc on white is approximately 1.6:1 */
.placeholder-text {
  color: #cccccc;
  background-color: #ffffff;
}

Why It Matters

The thresholds in WCAG 1.4.3 Contrast (Minimum) (opens in new tab) and WCAG 1.4.11 Non-text Contrast (opens in new tab) are not aesthetic preferences; they are readability requirements for text and UI states people need to perceive.

  • Low Vision: Users with moderately low vision (20/80 after correction) may not perceive text below 4.5:1 without assistive magnification.
  • Color Blindness: Red-green color blindness affects ~8% of males — color alone cannot distinguish elements; contrast is the universal signal.
  • Aging Vision: Contrast sensitivity decreases with age; older users benefit from higher contrast even without a clinical diagnosis.
  • Environmental Factors: Bright sunlight washes out screens — higher contrast helps in outdoor use.
  • Compliance: WCAG 2.1 Level AA (SC 1.4.3) is the baseline for most legal accessibility regulations (ADA, EN 301 549, AODA).

Contrast Ratio Requirements

Content TypeWCAG AA MinimumWCAG AAA Enhanced
Normal text (< 18pt / < 14pt bold)4.5:17:1
Large text (≥ 18pt or ≥ 14pt bold)3:14.5:1
UI components (icons, inputs, buttons)3:1
Decorative / inactive / logotypesExemptExempt

Best Practices

  • Check contrast in all interactive states: :hover, :focus, :active, :visited, and disabled.
  • Disabled elements are technically exempt, but overly light disabled states still hurt usability.
  • Use browser DevTools (Chrome/Firefox Accessibility panel) for quick checks during development.
  • Do not rely solely on automated tools — manual checks with real content and backgrounds are needed.

Tools & Validation

Exceptions

  • Evaluate the rendered experience before treating a static-code smell as a blocker; interaction timing, browser behavior, and assistive technology output often determine severity.
  • Not every secondary accessibility issue deserves equal weight; prioritize the issue that most directly blocks perception, operation, or understanding.
  • Avoid adding redundant markup or ARIA solely to satisfy a rule when a simpler semantic implementation would eliminate the issue entirely.

Verification

Automated Checks

  • Inspect the browser accessibility tree or accessibility pane for the relevant element, role, or accessible name.
  • Run an automated accessibility checker such as axe or Lighthouse where applicable.

Manual Checks

  • Test the affected UI with keyboard-only navigation and confirm the rule holds in the rendered experience.
  • Re-test one representative user flow with a screen reader if this rule affects a key interaction.

Use with AI

Copy these prompts to use with your AI assistant, or install the MCP server to use directly from Claude, Cursor, or Windsurf.

Check

Verify implementation

Evaluate the contrast ratio between text color and its background for all text on the page. Use the WCAG relative luminance formula: for normal text (< 18pt or < 14pt bold), the ratio must be ≥ 4.5:1; for large text (≥ 18pt or ≥ 14pt bold), the ratio must be ≥ 3:1. Also check non-text UI components (input borders, button outlines, icons) for ≥ 3:1 ratio against adjacent colors per WCAG 2.1 SC 1.4.11. Check all interactive states: default, hover, focus, active, and visited.

Fix

Auto-fix issues

Darken the foreground color or lighten/darken the background color until the ratio meets the minimum. For normal text failing 4.5:1: increase text darkness or background lightness. For large text failing 3:1: apply same approach with a lower threshold. Use a contrast checker tool (WebAIM, browser DevTools accessibility panel) to verify the exact ratio. Do not use opacity to lighten text — compute the effective blended color and check that ratio instead.

Explain

Learn more

WCAG 2.1 SC 1.4.3 (Contrast Minimum, Level AA) requires a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (≥ 18pt regular or ≥ 14pt bold). Contrast ratio is calculated from the relative luminance of the foreground and background colors using the formula (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter and L2 is the darker color. A ratio of 1:1 means no contrast (same color); 21:1 is maximum (black on white). Users with low vision, cataracts, or color blindness rely on high contrast to distinguish text from its background.

Review

Code review

Review the rendered markup and interactive states that affect Meet minimum color contrast ratios. Flag exact elements, roles, labels, focus behavior, or keyboard interactions that violate the rule, and note how to verify the fix with browser accessibility tooling or assistive tech.

Sources

References used to support the guidance in this rule.

Further Reading

Tools and supplementary material for exploring the topic in more depth.

axe DevTools
deque.comTool

Rules that often go hand-in-hand with this one.

Make links in text blocks visually distinguishable

Links within blocks of text must be distinguishable from surrounding non-link text by more than color alone.

Accessibility
Provide sufficient touch target size

Interactive elements must have large enough touch targets so users with motor impairments can activate them accurately on touchscreen devices.

Accessibility
Provide visible custom focus indicators

Ensure all interactive elements have a clearly visible focus indicator for keyboard navigation — never just remove the default outline without providing a better alternative.

CSS

Was this rule helpful?

Your feedback helps improve rule quality. This stays internal for now.

Loading feedback...
0 / 385