WCAG 2.1 · live preview · client-side

Color Contrast Checker

Enter a foreground and background color to get the exact WCAG contrast ratio and instant AA / AAA pass or fail for normal text, large text, and UI components — with a live preview.

Colors 🎨 Foreground & Background

Large text preview
Normal body text preview — the quick brown fox jumps over the lazy dog.

Result ✅ WCAG Compliance

21.00:1
contrast ratio (1:1 lowest → 21:1 highest)
AA · Normal text (≥ 4.5:1)PASS
AA · Large text (≥ 3:1)PASS
AAA · Normal text (≥ 7:1)PASS
AAA · Large text (≥ 4.5:1)PASS
UI components / graphics (≥ 3:1)PASS
Relative luminance (FG / BG)

Large text = 18pt (24px) regular, or 14pt (~18.7px) bold and above.

Make your text readable for everyone

This color contrast checker measures the WCAG contrast ratio between any two colors and tells you immediately whether the pair passes WCAG 2.1 Level AA and AAA for normal text, large text, and user-interface components. Sufficient contrast is what makes text legible for users with low vision, color vision deficiency, or anyone reading on a glary phone screen outdoors — and it is a legal accessibility requirement in many jurisdictions. Pick your colors and read the verdict; all of the math happens locally in your browser with a live preview.

How the WCAG contrast ratio is calculated

Contrast is the ratio of the relative luminance of the lighter color to the darker color, nudged by a small constant so the scale runs cleanly from 1:1 (identical colors) to 21:1 (pure black on pure white):

ratio = (L_light + 0.05) / (L_dark + 0.05)

Relative luminance L is not a simple average of the RGB channels. Each sRGB channel is first linearised to undo gamma encoding, then the channels are weighted by how strongly the human eye perceives them — green counts far more than blue:

c_lin = (c ≤ 0.03928) ? c/12.92 : ((c + 0.055)/1.055) ^ 2.4
L = 0.2126 × R_lin + 0.7152 × G_lin + 0.0722 × B_lin

That green-heavy weighting is why yellow text on white fails badly (yellow is very luminous) while the same-looking blue on white can pass.

The WCAG thresholds

LevelNormal textLarge textUI / graphics
AA4.5:13:13:1
AAA7:14.5:1

Large text is at least 18pt (24px) at regular weight, or 14pt (~18.7px) at bold weight. The non-text contrast rule (WCAG 1.4.11) requires 3:1 for the boundaries of UI components like input borders, focus rings, icons, and chart elements.

Practical tips to fix failing contrast

Why contrast matters beyond compliance

Roughly 1 in 12 men and 1 in 200 women have some form of color vision deficiency, and a far larger share of users read in poor lighting or with aging eyes. Meeting WCAG AA isn't just box-ticking for ADA, the European Accessibility Act, or India's RPwD guidelines — higher contrast measurably improves comprehension and conversion for all users. Pair this checker with the aspect ratio calculator and subnet calculator in the free DevCalc hub.

Color Contrast FAQ

What is a color contrast checker?+
A color contrast checker measures the luminance contrast ratio between a foreground (text) color and a background color, then reports whether that ratio meets WCAG thresholds: 4.5:1 for AA normal text, 3:1 for AA large text, and 7:1 for AAA normal text.
What is the WCAG contrast ratio formula?+
Contrast ratio = (L1 + 0.05) / (L2 + 0.05), where L1 is the relative luminance of the lighter color and L2 of the darker. Relative luminance linearises each sRGB channel and weights them 0.2126 R + 0.7152 G + 0.0722 B. The result ranges from 1:1 to 21:1.
What contrast ratio do I need to pass WCAG AA?+
WCAG 2.1 Level AA requires at least 4.5:1 for normal text and 3:1 for large text (18pt, or 14pt bold, and above). UI components and graphical objects also need at least 3:1 against adjacent colors.
What is the difference between AA and AAA?+
AAA is stricter: 7:1 for normal text and 4.5:1 for large text, versus AA at 4.5:1 and 3:1. Most products target AA as the practical baseline; AAA is recommended where the highest accessibility is required.
What counts as large text in WCAG?+
Large text is at least 18 point (24px) for regular weight, or at least 14 point (about 18.66px) for bold weight. Larger glyphs stay legible at lower contrast, so the requirement is lower.
Is this contrast checker free and private?+
Yes. It is free with no signup and runs entirely in your browser — your colors are never sent to a server.