Skip to content
All tools
English

Color contrast checker

Enter a text colour and a background. You get the WCAG ratio, pass or fail for each level, and the nearest colours that pass.

Runs in your browser, nothing is uploaded

Large heading text

The quick brown fox jumps over the lazy dog.

نص عربي للتجربة: الخط الواضح يريح العين.

Button

How to use it

  1. Set both colours

    Any CSS format works. Use the swap button to test light text on a dark background.

  2. Read the results

    Normal text needs 4.5:1 for AA, large text and UI parts need 3:1. AAA asks for 7:1.

  3. Fix what fails

    Apply a suggested colour: same hue, only as much lighter or darker as needed.

What the WCAG levels mean

CheckMinimum ratioSuccess criterion
AA, normal text4.5:11.4.3 Contrast (Minimum)
AA, large text3:11.4.3
AAA, normal text7:11.4.6 Contrast (Enhanced)
AAA, large text4.5:11.4.6
Icons, input borders, focus rings3:11.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.

Frequently asked questions

What contrast ratio do I need?
For WCAG 2.2 level AA: 4.5:1 for normal text, 3:1 for large text and for icons and form borders. Level AAA asks for 7:1 for normal text and 4.5:1 for large text.
Does placeholder or disabled text need to pass?
Placeholder text is still text, so it should meet 4.5:1. Text in disabled controls is exempt from 1.4.3, but it still needs to be readable enough for people to tell what it is.
Why is my result different from another checker?
Some tools round 4.47 up to 4.5 and show a pass, or use the older 0.03928 threshold in the formula. The threshold makes no visible difference; the rounding does. We never round up.
Can I check text on an image or gradient?
Test the lightest and the darkest part of the background behind the text. Both have to pass, so the weakest spot is the one that counts.