Verify if your color combinations meet WCAG 2.1 accessibility standards for AA and AAA compliance levels.
The WCAG contrast checker calculates the relative luminance of each color by linearizing the sRGB values: each channel is divided by 255, then if the value is ≤ 0.04045 it's divided by 12.92, otherwise ((value + 0.055) / 1.055) raised to the power of 2.4. The luminance is computed as L = 0.2126×R + 0.7152×G + 0.0722×B. The contrast ratio is then (L_lighter + 0.05) ÷ (L_darker + 0.05), producing a value from 1:1 to 21:1. This ratio is compared against WCAG 2.1 thresholds for AA and AAA compliance at both normal and large text sizes.
WCAG 2.1 requires a minimum contrast ratio of 4.5:1 for normal text (Level AA) and 3:1 for large text (18px or 14px bold). For Level AAA compliance, normal text needs 7:1 and large text needs 4.5:1.
Contrast ratio is calculated using the relative luminance of each color. Each RGB channel is linearized, then combined using the formula L = 0.2126R + 0.7152G + 0.0722B. The ratio is (L1 + 0.05) / (L2 + 0.05) where L1 is the lighter color.
In WCAG, large text is defined as text that is at least 18pt (24px) or 14pt (18.66px) bold. Large text has a lower contrast requirement of 3:1 for Level AA because the increased size makes it easier to read.