Web Color Contrast & Accessibility (WCAG Ratios & Colorblind Considerations)

Last updated: 2026-06-25

TL;DR

The core of web accessibility is the luminance contrast between text and background. Under WCAG 2.1, body text must meet 4.5:1 and large text 3:1, while the stricter AAA requires 7:1 and 4.5:1 respectively.

On top of that, not relying on color alone — and considering colorblind users — lets more people read comfortably.

Why color contrast matters

The most common accessibility problem on websites is "the text is hard to read." Light gray text on a white background may look sleek, but it becomes hard to read for low-vision users, people viewing a screen in sunlight, or those on older monitors. Color contrast is not just an aesthetic choice — it is the foundation of readability that makes content legible to everyone.

The international standard WCAG (Web Content Accessibility Guidelines) defines this readability as a measurable number: the luminance contrast ratio between text color and background color. Many national accessibility standards follow the same contrast criteria, so it is useful to know across both public and private sectors.

What is contrast ratio and how is it calculated

Contrast ratio expresses the brightness difference between two colors as a ratio from 1:1 to 21:1. Identical colors are 1:1, and pure black against pure white reaches the maximum of 21:1. The calculation has two steps.

Doing this by hand is tedious. Enter a foreground and background color into the contrast checker to see the ratio and grade pass status instantly.

WCAG 2.1 contrast criteria, summarized

WCAG divides conformance into levels A, AA, and AAA. For contrast, AA is usually the practical minimum, and AAA is the target when higher accessibility is needed. The fact that criteria change with text size is important.

WCAG 2.1 minimum color contrast thresholds
TargetAA (minimum)AAA (enhanced)
Normal body text4.5:17:1
Large text (18pt+ or 14pt bold)3:14.5:1
UI components & graphical objects (non-text)3:1
Decorative text & logosNo requirementNo requirement

Here "large text" means roughly 24px (18pt) or larger, or 18.66px (14pt) or larger when bold. Large text has thicker strokes and reads more easily at the same contrast, so the threshold is relaxed. Non-text elements like button borders, input outlines, icons, and chart lines and bars must also meet the 3:1 threshold so users can perceive their presence and state.

Don't rely on color alone

Meeting contrast does not finish accessibility. Another core WCAG principle is "do not use color as the only means of conveying information." Color vision deficiency (color blindness) affects about 8% of men and 0.5% of women worldwide. To them, information distinguished by red and green alone can look nearly the same color.

For example, if a form marks error fields only with a red border, red-green colorblind users struggle to tell which field is wrong. The fix is simple: add a text message ("Email format is invalid") along with the color, a warning icon, and an underline or pattern, so the information comes through even without seeing the color. In charts, prefer dashed/solid lines, marker shapes, and direct labels over differing line colors alone.

Understanding types of color blindness

Color vision deficiency occurs when some of the retina's cone cells are missing or weakened. The most common red-green deficiency makes reds and greens hard to distinguish, while the rarer blue-yellow deficiency affects blues and yellows. If your design relies on these color pairs, it is wise to verify the conversion results with the colorblind simulator.

Main types of color vision deficiency and design cautions
TypeEasily confused colorsResponse
Protanopia & deuteranopia (red-green)Red ↔ green, brown ↔ greenDon't use red/green alone for state; pair icons and text
Tritanopia (blue-yellow)Blue ↔ green, yellow ↔ pinkDon't rely on blue/yellow contrast
AchromatopsiaNearly all colors (only lightness perceived)Sufficient luminance contrast is decisive

The countermeasure effective for all types is ultimately to secure sufficient luminance contrast. If hues differ but brightness is similar, they look almost identical under color vision deficiency; but with a large brightness difference, users can read the shapes and text even without distinguishing color.

The order for choosing colors in practice

To pick colors that are both accessible and attractive, we recommend this order.

Summary

Frequently Asked Questions (FAQ)

What is the minimum contrast ratio for body text?

Under WCAG 2.1 AA, normal body text must be at least 4.5:1. The stricter AAA is 7:1. Large text — 18pt or larger, or 14pt bold — is relaxed to AA 3:1 and AAA 4.5:1.

Why shouldn't I rely on color alone?

Colorblind users have trouble distinguishing information by color alone. For example, if you mark success and failure using only red and green, red-green colorblind users cannot tell them apart. You must pair color with text, icons, and patterns.

Can I calculate the contrast ratio myself?

Linearize each color from sRGB to compute relative luminance, then use (lighter + 0.05) / (darker + 0.05). If doing it by hand is tedious, the contrast checker gives the value instantly.

Last updated: 2026-06-25