DSN

Color Contrast Checker

Enter a text color and a background color as hex codes to get the exact contrast ratio and WCAG pass/fail results.

— Enter two hex colors, then check.

How it's calculated

This follows the WCAG 2.x formula exactly: each color's relative luminance is calculated from its sRGB channels, then the contrast ratio is (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter color's luminance. A ratio of 21:1 (pure black on white) is the maximum possible.

WCAG thresholds

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

Frequently asked

What's the difference between AA and AAA?

AA is the WCAG minimum level most accessibility guidelines and laws reference. AAA is a stricter, enhanced level — harder to meet, and not required for most sites, but better for readability.

Does this account for colorblindness?

No — this checks luminance contrast only, which covers most low-vision needs but not full color-vision deficiency. For colorblind-safe palettes, avoid relying on hue alone (red/green) to convey meaning.