Free Tool
Color Contrast Calculator
Ensure your text and background colors meet WCAG 2.1 AA and AAA contrast requirements.
Last updated: June 2026Ask AI about this
Contrast Ratio
21.00:1
WCAG AA (Normal)
WCAG AA (Large)
WCAG AAA (Normal)
WCAG AAA (Large)
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.03928→c = 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.