WCAG Color Contrast Checker
Is there enough contrast between the text color and the background by the WCAG standard: the ratio and the AA and AAA levels for normal and large text.
the scale: thresholds 3, 4.5 and 7; the marker is your contrast
How it is calculated
Relative luminance L = 0.2126 × R + 0.7152 × G + 0.0722 × B, where R, G, B are the linear values (the sRGB gamma removed) from 0 to 1.
Contrast = (L1 + 0.05) ÷ (L2 + 0.05), where L1 is the lighter color. AA needs 4.5 (3 for large text), AAA needs 7 (4.5 for large text). Large text is 24 px and up, or 18.7 px and up in bold.
L = 0.2126·R + 0.7152·G + 0.0722·B (linear) contrast = (L1 + 0.05) / (L2 + 0.05)
Worked example
Black on white: (1 + 0.05) ÷ (0 + 0.05) = 21.0.
#777777 on white: L = 0.184, contrast = 1.05 ÷ 0.234 = 4.48, which is below 4.5, so AA for normal text fails.
It checks the color ratio only; accessibility also depends on the font, the size and the context.
Check a PDF