Windows Developer Power Tools
Blacksun Software

WCAG Color Contrast Requirements — AA & AAA Ratios Explained

How to Meet Web Accessibility Standards for Text and Background Color in Your Designs

Poor color contrast is one of the most common accessibility barriers on the web. The Web Content Accessibility Guidelines (WCAG) define minimum contrast ratios so that people with low vision or color blindness can read text on screen. This guide explains how contrast ratios work, what the WCAG thresholds are, and how to choose compliant colors.

What Is Contrast Ratio?

Contrast ratio is a measure of the luminance difference between two colors — typically the foreground (text) and background. It is calculated from each color's relative luminance, a value that accounts for how the human eye perceives brightness differently across the red, green, and blue channels.

The WCAG formula is:

(L1 + 0.05) / (L2 + 0.05)

Where L1 is the relative luminance of the lighter color and L2 is the relative luminance of the darker color. The result is expressed as a ratio, such as 4.5:1 or 7:1.

  • 1:1 — identical colors, no contrast whatsoever (e.g., white text on a white background)
  • 21:1 — maximum possible contrast (black on white)
  • Most readable body text falls between 7:1 and 15:1 in real-world designs

You do not need to calculate relative luminance by hand — every contrast checking tool does this automatically. What matters is understanding what ratio your color pairs achieve and whether that meets the required threshold.

WCAG 2.1 Contrast Requirements

WCAG defines two conformance levels for contrast: AA (the widely accepted legal and industry standard) and AAA (enhanced accessibility, typically targeted by government and healthcare sites). WCAG 2.2, published in 2023, maintains the same contrast thresholds as WCAG 2.1.

Level Text Type Minimum Ratio Notes
AA Normal text (smaller than 18pt regular or 14pt bold) 4.5:1 Most common compliance target for body text and UI labels
AA Large text (18pt regular or 14pt bold and above) 3:1 Headings typically qualify; verify the rendered size in px
AA UI components and graphical objects 3:1 Applies to button borders, icons, chart elements, form inputs
AAA Normal text 7:1 Enhanced level — recommended for maximum readability
AAA Large text 4.5:1 Enhanced level for large text and headings

Text that is purely decorative, part of a logo, or inactive (disabled UI) is exempt from contrast requirements. All other visible text — including placeholder text in form fields and text in images — is subject to these thresholds.

Common Contrast Failures

Many frequently used color combinations fail WCAG AA requirements. Light gray text on a white background is an especially common offender — it looks clean in a design tool but becomes unreadable for users with low vision or in bright ambient light conditions.

Foreground Background Ratio AA Pass?
Black #000000 White #FFFFFF 21:1 Yes — maximum contrast
White #FFFFFF Blue #0000FF 8.59:1 Yes
Gray #767676 White #FFFFFF 4.54:1 Yes — barely passes for normal text
Light gray #AAAAAA White #FFFFFF 2.32:1 No — very common failure in modern UI design
Yellow #FFFF00 White #FFFFFF 1.07:1 No — almost completely invisible
White #FFFFFF Red #FF0000 3.99:1 No — fails for normal text; only passes for large text
White #FFFFFF Darker red #CC0000 5.74:1 Yes — a small darkening makes a significant difference
Dark gray #333333 Near-white #F5F5F5 12.6:1 Yes — comfortable reading contrast
Color Blindness Considerations

Contrast ratio addresses luminance difference, but color blindness involves difficulty distinguishing specific hues. These are separate concerns and both must be considered. Approximately 8% of males and 0.5% of females have some form of color vision deficiency.

Type Channel affected Prevalence
Deuteranopia Green deficiency Most common — approximately 6% of males
Protanopia Red deficiency Approximately 1% of males
Tritanopia Blue deficiency Rare — less than 0.01% of the population

Key design rules for color-blind users:

  • Never rely on color alone to convey information — use shape, pattern, icon, or text labels alongside color coding
  • Avoid red/green as the only distinction — this is the most frequently confused pair (deuteranopia and protanopia both affect it)
  • Test in grayscale — if your design still communicates clearly without any color, it will work for most color vision deficiencies
  • Contrast ratio requirements protect against luminance-based issues; they do not protect against hue-based confusion — you need to address both independently
  • Browser DevTools and dedicated simulators (e.g., Colour Contrast Analyser from TPGi) can preview your page through various color blindness filters
Practical Tips for Compliant Color Schemes
  • Start dark: dark text on a light background is easier to control and verify than light text on a dark background, and tends to produce higher contrast ratios at moderate color values
  • Use a contrast checker before finalizing any color pair — do not guess; even experienced designers misjudge luminance contrast
  • Body text: aim for 7:1 or higher (AAA) for the most comfortable long-form reading experience, even if your legal target is only AA (4.5:1)
  • Placeholder text in form fields is technically exempt from contrast requirements, but aim for 4.5:1 anyway — low-contrast placeholders are a usability problem for everyone, not just users with low vision
  • Hover and focus states must also meet contrast requirements — an outline or highlight that lacks sufficient contrast against both the element and the page background fails WCAG
  • Do not rely on font weight to compensate for low contrast — making text bold does not improve its contrast ratio; only the color values determine the ratio
  • Check your disabled and inactive states — while exempt from contrast rules, overly invisible disabled controls can create confusion about whether a feature exists at all
Testing Tools

A range of free and paid tools make it straightforward to check contrast ratios during design and development. Using at least one at every stage of the process — design, development, and QA — prevents accessibility regressions from reaching production.

Tool Type Notes
Browser DevTools (Chrome / Firefox) Free — built-in The Accessibility panel in both Chrome and Firefox DevTools highlights contrast failures directly on the page and shows the ratio for any selected element
WebAIM Contrast Checker Free — online Enter any two hex codes at webaim.org/resources/contrastchecker/ to instantly see the ratio and whether it passes AA and AAA for both normal and large text
Colour Contrast Analyser (TPGi) Free — desktop app Windows and macOS application with a built-in eyedropper for sampling screen colors; also includes color blindness simulation views
axe DevTools Browser extension Full WCAG audit extension for Chrome and Firefox; automatically finds contrast failures and other accessibility issues across an entire page
ColorMania (blacksunsoftware.com) Free — Windows desktop app Pixel-accurate color picker for Windows; sample any color on screen and instantly get its hex, RGB, HSL, and CMYK values — then paste into any contrast checker for WCAG validation
Pick Exact Colors with ColorMania
🎨
Pick Exact Colors with ColorMania

Use ColorMania's pixel-accurate color picker to get the exact hex and RGB values of any color on screen — then paste them into a contrast checker for instant WCAG validation. Free for Windows, no installation complexity.

Get ColorMania Free →
Related Articles