Accessibility tool

Color Contrast Calculator

Ensure your text and background colors meet WCAG 2.1 AA and AAA contrast requirements.

Contrast ratio is 21.00 to 1.
A minimum ratio of 4.5:1 is required for normal text (WCAG AA).
WCAG AA (Normal)
Pass
Requires 4.5:1
WCAG AA (Large)
Pass
Requires 3.0:1
WCAG AAA (Normal)
Pass
Requires 7.0:1
WCAG AAA (Large)
Pass
Requires 4.5:1
The quick brown fox
Large Text (≥ 18pt or 14pt bold)
The quick brown fox jumps over the lazy dog.
Normal Text

How to use this tool

Enter your foreground and background colors in hex format.

The calculator will automatically determine if they meet WCAG contrast requirements.

Relative Luminance Formula

L = 0.2126·R + 0.7152·G + 0.0722·B

Where R, G, and B are linearized channels:

  • If c_sRGB ≤ 0.03928c = c_sRGB / 12.92
  • Else → c = ((c_sRGB + 0.055) / 1.055) ^ 2.4

The contrast ratio (CR) is then calculated as: CR = (L1 + 0.05) / (L2 + 0.05) where L1 is the lighter color and L2 is the darker color.

What this tool checks

This tool automatically checks the color contrast ratio between your text and background against WCAG 2.1 AA and AAA standards.

Limitations of automated testing

Automated contrast checkers cannot accurately evaluate contrast over gradients, background images, or complex background patterns. These scenarios require manual verification.

Related Tools

Related Guides