Color Contrast Checker — WCAG AA & AAA Requirements, Formula & Accessible Color Guide

Everything you need to check color contrast for WCAG 2.1 compliance — the exact contrast ratio formula, minimum requirements for normal and large text, AA vs AAA explained, 12 real color pair examples with pass/fail, the most common failure patterns, and how to fix them. Free checker, no signup.

Published May 15, 2026 · 11 min read · Developer
Check your color pair's contrast ratio instantly
WCAG AA & AAA pass/fail · live preview · adjustable font size & weight · free
Open Contrast Checker →

What Is Color Contrast Ratio?

Color contrast ratio is a numerical measure of how visually distinct two colors are from each other — specifically, the difference in luminance (perceived brightness) between a foreground color (usually text) and its background. The ratio ranges from 1:1 (two identical colors — no contrast at all) to 21:1 (pure black on pure white — maximum possible contrast).

The Web Content Accessibility Guidelines (WCAG) use contrast ratio as the primary metric for color accessibility because it correlates well with readability for people with low vision, color blindness, and age-related vision decline — and because it's mathematically objective, unlike more subjective readability assessments.

WCAG 2.1 Contrast Requirements at a Glance

WCAG 2.1 defines contrast requirements across two conformance levels (AA and AAA) and three content types (normal text, large text, and non-text elements). Here's everything in one table:

CriterionMinimum RatioApplies toRequired?
AA — Normal text4.5:1Body copy, labels, form fields — under 18px regular or 14px bold✅ AA (legal minimum)
AA — Large text3:1Headings and large UI text — 18px+ regular or 14px+ bold✅ AA (legal minimum)
AA — Non-text3:1Icons, borders, focus indicators, charts, UI component boundaries✅ AA (legal minimum)
AAA — Normal text7:1Enhanced level for normal text — aspirational, not universally required⭐ AAA (enhanced)
AAA — Large text4.5:1Enhanced level for large text — same as AA normal text requirement⭐ AAA (enhanced)

WCAG AA vs AAA — Which Do You Need?

WCAG AA is the standard minimum — it's what most accessibility laws and regulations require (ADA in the US, EN 301 549 in Europe, the Equality Act in the UK). If your site is public-facing and you care about legal compliance or serving all users, AA is your baseline. Aim for 4.5:1 on all body text and 3:1 on all large headings and UI components.

WCAG AAA is the enhanced level. It requires 7:1 for normal text — a very high bar that often conflicts with brand color palettes. WCAG itself notes that "it is not possible to satisfy all Level AAA Success Criteria for some content." AAA is aspirational: target it where you can, but don't sacrifice your design or brand identity to reach it everywhere.

Practical targets for most product teams:

  • Body text: 4.5:1 minimum (AA), aim for 7:1+ where feasible (AAA)
  • Headings (18px+): 3:1 minimum (AA large text)
  • Buttons and CTAs: 4.5:1 on the button text; 3:1 on the button border vs background
  • Form placeholders: 4.5:1 — placeholders are functional text, not decorative
  • Disabled elements: Exempt from WCAG contrast requirements
  • Decorative graphics: Exempt if they convey no information

How Contrast Ratio Is Calculated — The Formula

The WCAG contrast ratio formula is more complex than it looks — it accounts for how human vision perceives brightness non-linearly. Here's the full calculation:

Step 1 — Convert RGB to linear light
// For each channel (R, G, B), normalize to 0–1 then gamma-correct:
const sRGB = channel / 255;
const linear = sRGB <= 0.03928
  ? sRGB / 12.92
  : Math.pow((sRGB + 0.055) / 1.055, 2.4);
Step 2 — Calculate relative luminance
// Weighted sum reflecting human perception (green contributes most)
const L = 0.2126 * R_linear + 0.7152 * G_linear + 0.0722 * B_linear;
// L ranges from 0 (black) to 1 (white)
Step 3 — Calculate contrast ratio
// L1 = luminance of the lighter color, L2 = luminance of the darker
const ratio = (L1 + 0.05) / (L2 + 0.05);
// Range: 1:1 (same color) to 21:1 (black on white)

The 0.05 offset prevents division by zero when comparing pure black (L=0) against itself. The weights (0.2126, 0.7152, 0.0722) reflect that green light contributes roughly 72% of perceived brightness, red about 21%, and blue only 7% — matching human photoreceptor sensitivity.

What Counts as "Large Text" in WCAG?

WCAG defines large text precisely — and the definition matters because large text gets a more lenient contrast requirement (3:1 instead of 4.5:1):

18px+LARGE
Regular (400)
Min ratio: 3:1 (AA)
14px+LARGE
Bold (700)
Min ratio: 3:1 (AA)
17pxNORMAL
Regular
Min ratio: 4.5:1 (AA)
13pxNORMAL
Bold
Min ratio: 4.5:1 (AA)
24pxLARGE
Any
Min ratio: 3:1 (AA)
12pxNORMAL
Any
Min ratio: 4.5:1 (AA)

WCAG uses point sizes in its formal specification (18pt / 14pt bold), but in practice most web projects work in pixels. The conversion is: 18pt = 24px, 14pt = approximately 18.67px — rounded to 18px in common usage. The ToolLance Contrast Checker lets you set the exact pixel size and weight, and automatically applies the correct WCAG threshold.

12 Color Combinations — Contrast Ratio Pass/Fail

Real examples of common design color pairs, with their exact contrast ratios and WCAG AA/AAA results. The failing examples are some of the most commonly used patterns on the web today.

PreviewColorsRatioAAAAANotes
Aa
Black
on White
21.0:1✅ Pass✅ PassMaximum possible contrast
Aa
Gray-800
on Gray-50
16.0:1✅ Pass✅ PassPopular dark text on light bg
Aa
White
on Blue-700
7.9:1✅ Pass✅ PassWhite on strong blue — buttons
Aa
White
on Blue-600
5.9:1✅ Pass❌ FailCommon primary button pattern
Aa
Gray-700
on Gray-100
9.7:1✅ Pass✅ PassSubtle text on soft background
Aa
White
on Blue-500
3.9:1❌ Fail❌ Fail❌ Common failure — too light
Aa
Gray-500
on White
4.6:1✅ Pass❌ FailPlaceholder text — barely passes
Aa
Gray-400
on White
2.5:1❌ Fail❌ Fail❌ Very common failure — muted text
Aa
White
on Red-500
4.1:1❌ Fail❌ Fail❌ White on medium red fails
Aa
White
on Red-600
5.3:1✅ Pass❌ FailDarker red passes AA
Aa
Black
on Yellow-400
11.4:1✅ Pass✅ PassHigh vis — warnings, highlights
Aa
White
on Green-600
4.6:1✅ Pass❌ FailWhite on green — success states

The 6 Most Common Contrast Failures (And How to Fix Each)

These are the patterns that appear most frequently in accessibility audits of real websites. Each one has a specific fix that preserves the design intent while reaching WCAG compliance.

1. Gray text on white
#9CA3AF on #FFFFFFratio: 2.5:1
Fix: Use #6B7280 (Gray-500) at minimum. For body copy, use #374151 (Gray-700) or darker.
2. Light blue on white
#60A5FA on #FFFFFFratio: 3.0:1
Fix: Switch to #2563EB (Blue-600) or darker for normal text, or increase font size to 18px+ for large text exemption.
3. White on medium-tone background
#FFFFFF on #3B82F6ratio: 3.9:1
Fix: Darken the background to #2563EB (Blue-600, ratio 5.9:1) or #1D4ED8 (Blue-700, ratio 7.9:1).
4. Yellow text on white
#FBBF24 on #FFFFFFratio: 1.9:1
Fix: Yellow on white is nearly unusable. Use yellow as a background (#FBBF24) with black text (#000000, ratio 13.9:1) instead.
5. Light green on white
#4ADE80 on #FFFFFFratio: 2.1:1
Fix: Light greens are the worst for accessibility. Use #15803D (Green-700) or darker for text. Keep light greens as background fills only.
6. White on red-500
#FFFFFF on #EF4444ratio: 4.1:1
Fix: Darken the red: #DC2626 (Red-600) gives 5.3:1 (passes AA). #B91C1C (Red-700) gives 7.1:1 (passes AAA).

How to Check Color Contrast for Your Design

The fastest workflow for checking contrast during design — using ToolLance's Contrast Checker:

1
Open the Contrast Checker tab
Go to toollance.com/tools/color-picker and click the Contrast Checker tab.
2
Enter your foreground color (text color)
Use the color picker or type a HEX code in the Foreground field. This is the color of your text or icon.
3
Enter your background color
Type the HEX code of the surface the text sits on — a card background, button fill, input field, etc.
4
Set the font size and weight
Adjust the slider to your actual font size and toggle bold if the text is bold. This determines whether WCAG large text requirements (3:1) or normal text requirements (4.5:1) apply.
5
Read the result and adjust if needed
The ratio and pass/fail badges update instantly. If you fail AA, darken the text color or lighten the background — the preview updates live so you can see the change immediately.

Contrast for Non-Text Elements — Icons, Borders, and UI Components

WCAG 2.1 Success Criterion 1.4.11 (Non-text Contrast) — a Level AA requirement — extends the 3:1 contrast requirement to UI components and graphical objects. This covers:

  • Icons that convey information (checkboxes, navigation icons, status indicators)
  • Focus indicators — the outline that appears when a keyboard user focuses an element
  • Form field borders — the border of an input or select field against its background
  • Button boundaries — when a button's fill is the same as the page background, the border must have 3:1 contrast
  • Chart elements — lines, bars, and data points that encode information

Decorative images, logos, and disabled state controls are explicitly exempt. The easiest way to check non-text contrast is the same tool — enter the icon color as foreground and the background color, then target 3:1.

7 Practical Tips for Accessible Color in Design Systems

1
Define accessible text shades for every brand color
For each brand color (primary, secondary, etc.), define at least one shade dark enough to use as text on white (4.5:1) and one light enough to put white text on (also 4.5:1). Bake these into your design tokens.
2
Never rely on color alone to convey information
Error states, success states, and required field indicators must use more than just color (e.g., an icon or underline) — some users cannot distinguish color differences.
3
Check contrast at every breakpoint
Text that is 18px on desktop may be 14px on mobile, changing it from large to normal text and raising the required ratio from 3:1 to 4.5:1.
4
Be careful with semi-transparent overlays
A dark overlay on an image creates variable contrast depending on the image content. Either use a solid background or check contrast against the lightest possible image region.
5
Test with real color blindness simulation
The Color Picker tab in ToolLance includes a color blindness simulator. Test your key color pairs under Deuteranopia (most common type — red-green) to ensure they remain distinguishable.
6
Document your contrast ratios in your design system
Annotate components with their contrast ratios. When a designer changes a color, the annotation makes it immediately obvious whether the change breaks compliance.
7
Use the color picker to generate accessible palettes
Start with a brand hue, then use the monochromatic palette generator to create shades from light to dark. Test each shade's contrast against white and black — you'll find at least two or three that pass AA for text and several that pass for large text.

Related Tools

After confirming contrast compliance, use the Palette Generator to build a full accessible color system from your brand colors — it generates monochromatic shades so you always have a compliant text shade available. The Color Blindness Simulator lets you preview how your palette appears under Protanopia, Deuteranopia, Tritanopia, and Achromatopsia. For HEX-to-RGB conversions needed during the process, the Color Converter outputs all formats from a single input.

Check your color pair now
Instant WCAG AA & AAA pass/fail · live preview · no signup · free
Open Contrast Checker →

Frequently Asked Questions

What contrast ratio is required by WCAG?

WCAG 2.1 Level AA requires 4.5:1 for normal text (under 18px regular or 14px bold) and 3:1 for large text (18px+ or 14px+ bold). Level AAA requires 7:1 for normal text and 4.5:1 for large text. AA is the legal minimum for most jurisdictions.

How is the contrast ratio calculated?

Contrast ratio = (L1 + 0.05) / (L2 + 0.05), where L1 and L2 are the relative luminances of the lighter and darker colors. Luminance is calculated by gamma-correcting each RGB channel and combining with weights 0.2126 (R), 0.7152 (G), 0.0722 (B). Ratios range from 1:1 to 21:1.

What is the difference between WCAG AA and AAA?

AA (4.5:1 for normal text) is the legal standard minimum required by most accessibility regulations. AAA (7:1 for normal text) is the enhanced level — aspirational but not universally achievable. Most sites target AA compliance; AAA is pursued where feasible.

What is considered large text in WCAG?

Large text is 18px (or 14pt) or larger at regular weight, or 14px (10.5pt) or larger at bold weight. Large text has a more lenient contrast requirement: 3:1 for AA instead of 4.5:1.

Does WCAG contrast apply to icons and UI components?

Yes — WCAG 2.1 SC 1.4.11 (Non-text Contrast) is an AA requirement that applies a 3:1 minimum to UI components (buttons, form fields, focus indicators) and meaningful graphical objects (icons, charts). Decorative images and disabled elements are exempt.

How do I fix a failing contrast ratio?

Three strategies: (1) Darken the foreground — reduce lightness in HSL until the ratio reaches 4.5:1; (2) Lighten the background — white is easiest; (3) Both — meet in the middle. Use ToolLance's Contrast Checker to test adjustments in real time.

What are accessible color combinations?

Reliably accessible pairs: black on white (21:1), dark gray (#374151) on light gray (#F9FAFB) (9.7:1), white on dark blue (#1D4ED8) (7.9:1), white on Blue-600 (#2563EB) (5.9:1), black on Yellow-400 (#FACC15) (11.4:1). Common failures: gray-400 on white (2.5:1), white on Blue-500 (3.9:1), white on Red-500 (4.1:1).