Color Contrast Checker
Large text sample (24px)
Normal text sample. The quick brown fox jumps over the lazy dog.
- Contrast ratio
- 6.18:1
- AA, normal text (4.5:1)
- ✓ Pass
- AA, large text (3:1)
- ✓ Pass
- AAA, normal text (7:1)
- ✗ Fail
- AAA, large text (4.5:1)
- ✓ Pass
Large text means at least 24px (18pt) regular, or 18.66px (14pt) bold.
Everything runs in your browser. Your data never leaves your device.
What this tool does
This colour contrast checker tells you whether text will be easy to read on a background colour. Enter a text colour and a background colour to see the contrast ratio, from 1:1 (no contrast) to 21:1 (black on white), and whether the pair passes the Web Content Accessibility Guidelines (WCAG) at levels AA and AAA for normal and large text. A live preview shows both text sizes in your colours.
How to use it
- Enter the text colour and the background colour as HEX, RGB or HSL, or pick them with the swatches.
- Read the ratio and the pass or fail result for each level.
- If a level fails, make the text darker or the background lighter (or the other way round) until it passes.
How the ratio is calculated
WCAG first works out the relative luminance of each colour: each red, green and blue value is converted to linear light, then weighted 21.26%, 71.52% and 7.22%. The ratio is (L1 + 0.05) ÷ (L2 + 0.05), where L1 is the lighter colour.
Example: grey #767676 on white has a ratio of 4.54:1, which passes AA for normal text. One step lighter, #777777, gives 4.47:1 and fails.
Why it matters
Good contrast helps people with low vision, older readers, and anyone using a phone in bright sunlight. Many countries require accessible websites for public services, and WCAG AA is the usual target.
Frequently asked questions
What contrast ratio do I need?
For WCAG level AA, normal text needs at least 4.5:1 and large text 3:1. Level AAA asks for 7:1 for normal text and 4.5:1 for large text.
What counts as large text?
Text of at least 24px (18pt) in regular weight, or at least 18.66px (14pt) in bold.
Why is the ratio not rounded up?
WCAG compares the exact ratio. A pair at 4.48:1 fails AA even though it rounds to 4.5, so the tool shows the value cut to two decimals to avoid a misleading pass.
Does contrast matter for buttons and icons?
Yes. WCAG asks for at least 3:1 between icons, input borders and other interface parts and the colours next to them.
Last updated: · What's new