How to use it
- Set both colours
Any CSS format works. Use the swap button to test light text on a dark background.
- Read the results
Normal text needs 4.5:1 for AA, large text and UI parts need 3:1. AAA asks for 7:1.
- Fix what fails
Apply a suggested colour: same hue, only as much lighter or darker as needed.
What the WCAG levels mean
| Check | Minimum ratio | Success criterion |
|---|---|---|
| AA, normal text | 4.5:1 | 1.4.3 Contrast (Minimum) |
| AA, large text | 3:1 | 1.4.3 |
| AAA, normal text | 7:1 | 1.4.6 Contrast (Enhanced) |
| AAA, large text | 4.5:1 | 1.4.6 |
| Icons, input borders, focus rings | 3:1 | 1.4.11 Non-text Contrast |
Large text means at least 18 point (24 CSS pixels) regular, or 14 point (about 18.66 CSS pixels) bold. Most laws and procurement rules that cite WCAG ask for level AA.
How the ratio is calculated
Each colour is converted to its relative luminance, a measure of how much light it gives off, from 0 for black to 1 for white. The ratio is (lighter + 0.05) ÷ (darker + 0.05), so it runs from 1:1 (same colour) to 21:1 (black on white). We show the ratio cut to two decimals, never rounded up: 4.499 is shown as 4.49 and fails AA, as it should.
If the text colour is transparent, we first blend it over the background, exactly as the browser would. A transparent background is assumed to sit on a white page.
What is APCA?
APCA (Accessible Perceptual Contrast Algorithm) is a newer method being studied for a future WCAG 3. It treats dark-on-light and light-on-dark differently and is usually shown as an Lc value from about 0 to 106. We show it for information only. WCAG 2.2 is the published standard today, so use the ratio for compliance.
How the suggestions work
We convert your colour to OKLCH and change only its lightness, keeping hue and chroma wherever sRGB allows, until the target ratio is met. Of the lighter and the darker option we offer the one that changes least, so your brand colour stays recognisable. Every suggested HEX code is checked again after rounding.
This tool helps you meet the colour contrast criteria. It does not make a page accessible on its own: text size, focus styles, alt text and keyboard use need checking too.