Frequently Asked Questions
How is the WCAG contrast ratio calculated?
Contrast = (L1 + 0.05) ÷ (L2 + 0.05), where L1 and L2 are the relative luminances of the lighter and darker colors. The ratio ranges from 1:1 (identical) to 21:1 (black on white).
How is relative luminance computed from RGB?
Each sRGB channel is normalized to 0–1, linearized (c ≤ 0.03928 → c ÷ 12.92, else ((c + 0.055) ÷ 1.055)²·⁴), then combined as L = 0.2126·R + 0.7152·G + 0.0722·B. Green is weighted most because the eye is most sensitive to it.
What ratios pass AA and AAA?
Normal text needs ≥ 4.5:1 for AA and ≥ 7:1 for AAA. Large text (≥ 18.66 px bold or ≥ 24 px regular) needs ≥ 3:1 for AA and ≥ 4.5:1 for AAA.
Do UI components and icons have a contrast requirement?
Yes - WCAG 2.1 requires non-text elements like form borders, focus indicators, and meaningful icons to meet at least 3:1 against adjacent colors.
Provided by AllCalculators.io
Free online calculators for everyday. No registration required.
Estimates for informational purposes only.
Important Disclaimer: Estimates for informational purposes only.
This calculator provides estimates for informational purposes only. Results are based on assumptions and may not reflect actual outcomes. Consult qualified professionals in relevant fields before making important decisions based on these results.