Skip to content
100% in your browser. Nothing you paste is uploaded — all processing runs locally. Read more →

WCAG Contrast Checker

Pick foreground and background colors. Get the WCAG contrast ratio and pass/fail for AA and AAA. Live preview with sample text.

#2563eb
Presets

WCAG contrast

Sample text
Sample small text — needs higher contrast for body copy
🔒 100% client-side · uses browser's native color parsing · no upload

The four WCAG thresholds

LevelNormal textLarge text (18pt+)
AA (minimum)4.5:13:1
AAA (enhanced)7:14.5:1

What "large text" means: at least 18pt (24px) regular, or 14pt (18.66px) bold. Anything smaller follows the normal-text threshold.

How the ratio is computed

For each color, compute relative luminance (a weighted, gamma-corrected sum of RGB):

L = 0.2126 R + 0.7152 G + 0.0722 B
   (R, G, B are linearized — squared / linearization formula)

Then the contrast ratio is:

(Lmax + 0.05) / (Lmin + 0.05)
   ranging from 1:1 (same color) to 21:1 (black on white)

Implementation in this tool follows WCAG 2.1's specification exactly.

Common ratios in popular palettes

ForegroundBackgroundRatioResult
#000 (black)#fff (white)21:1AAA, all sizes
#212529 (Bootstrap dark)#fff~16.1:1AAA
#6b7280 (gray-500)#fff~4.6:1AA normal, just barely
#9ca3af (gray-400)#fff~2.7:1Fails normal AA
#fff#2563eb (Tailwind blue-600)~5.2:1AA normal
#fff#3b82f6 (blue-500)~4.1:1Fails AA normal, OK for large

What contrast doesn't catch

A passing contrast ratio means the foreground/background brightness relationship is good enough. It doesn't catch:

Common patterns

Brand color over white

Most brand colors fail AA on white at normal size. Solutions:

Dark mode

Pure black on pure white (or vice versa) is too high-contrast for long reading. Use slightly off-black/white pairs:

Both pass AAA easily and are gentler on eyes than absolute extremes.

Try the related tools

FAQ

What ratio do I need?

WCAG 2.1 AA requires 4.5:1 for normal text and 3:1 for large text (18pt or 14pt bold and larger). AAA requires 7:1 for normal text and 4.5:1 for large text.

What about dark mode?

Same rules. Dark backgrounds need light enough text — and white text on a navy background can still fail AAA. Test both light and dark themes.

Are these the WCAG 2.x rules or APCA?

This tool uses WCAG 2.x's relative luminance formula, which is what most accessibility audits still check. APCA is the proposed WCAG 3 successor — better-correlated with perception, but not yet finalized. For audits today, target WCAG 2.x.

Does the tool consider color blindness?

Contrast checks luminance only — sufficient for most accessibility issues. For color-blindness simulation, use a dedicated tool (Sim Daltonism on macOS, Color Oracle cross-platform).