Color Contrast Checker

Check if your foreground and background colors meet WCAG 2.1 accessibility contrast ratios.

Color Input
Large Text (18px+)
Normal text example for contrast testing
Small body text 12px
Results
—
Contrast Ratio
—
Relative Luminance (FG)
Level Normal Text Large Text
WCAG AA — —
WCAG AAA — —
How It Works

This tool calculates the contrast ratio between two colors using the WCAG 2.1 formula. First, each color's RGB values are converted to relative luminance — each channel (R, G, B) is linearized by dividing by 255 and applying a gamma correction (power of 2.4 with an offset). The luminance is then computed as L = 0.2126×R + 0.7152×G + 0.0722×B. The contrast ratio is (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter luminance. Results are compared against WCAG thresholds: AA requires 4.5:1 (normal) or 3:1 (large text), while AAA requires 7:1 or 4.5:1 respectively.

FAQ
What is the minimum contrast ratio for WCAG AA compliance?
For WCAG AA compliance, normal text (under 18px or under 14px bold) requires a minimum contrast ratio of 4.5:1 against its background. Large text (18px and above, or 14px bold and above) requires at least 3:1 contrast ratio.
How is color contrast ratio calculated?
Contrast ratio is calculated using the relative luminance of each color. Each RGB channel is linearized, then combined using weighted coefficients (0.2126 for red, 0.7152 for green, 0.0722 for blue). The formula is (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter color's luminance.
Why is color contrast important for web accessibility?
Adequate color contrast ensures text is readable for people with visual impairments, color blindness, or those using screens in bright environments. It's a legal requirement under many accessibility laws and helps approximately 300 million people worldwide with color vision deficiency.
Related Tools
Free tools by TUNA — energy supply from vetted manufacturers