Compute WCAG contrast ratio & pass/fail.
The WCAG 2.1 contrast ratio is computed from relative luminance in linear sRGB.
L = (c<=0.03928 ? c/12.92 : ((c+0.055)/1.055)^2.4).0.2126 R + 0.7152 G + 0.0722 B.(L1+0.05)/(L2+0.05) with L1 ≥ L2.Thresholds: AA 4.5 (normal text), 3.0 (large); AAA 7.0 (normal), 4.5 (large).
All calculations local.
Only hex input; no alpha channel.
Looking for broader guides and best practices? Visit the ToolsAreUs Blog for indexes (like the full tool list) and articles (e.g. secure password generation).