Contrast checker
Compare two opaque colors against WCAG 2.2 contrast thresholds.
Get started
- Use the example values or enter your own measurements.
- Calculate, then copy the result or download the available details.
Example
Input
#000000 on #FFFFFFExpected result
21:1Good to know
The calculation runs in your browser. Use consistent units in fields with no explicit unit.
Calculation method
Contrast is (lighter luminance + 0.05) divided by (darker luminance + 0.05). Use the unrounded ratio for pass/fail. Normal text needs 4.5:1 for AA or 7:1 for AAA. Large text needs 3:1 for AA or 4.5:1 for AAA.