Formula
Contrast = (L1 + 0.05) / (L2 + 0.05), L = relative luminance (WCAG 2.1)
Worked example
With these values
- Text colour (hex)
- #17171a
- Background colour (hex)
- #ffffff
The calculator gives
- Contrast ratio (to 1)
- 17.89
- AA, normal text (4.5)
- Yes
- AA, large text (3)
- Yes
- AAA, normal text (7)
- Yes
These values are only an illustration. Replace them with yours in the form above.
How to use this calculator
Change any value: results update as you type. Copy a result with one click, or share a link that keeps all your values.
Questions
How is the result calculated?
The calculator applies this rule: Contrast = (L1 + 0.05) / (L2 + 0.05), L = relative luminance (WCAG 2.1)
Is it free?
Yes. It is free, needs no account, and works on phone and desktop.
Are my numbers stored?
Everything runs in your browser. Nothing you type is sent to a server.