Contrast Checker

Check a text and background colour against WCAG AA and AAA, and get a corrected colour when the pair fails.

Loading tool…

The colours are compared by arithmetic in this page. Nothing is uploaded and no colour you enter is recorded.

What the Contrast Checker does

The contrast checker on this page will check a text and background colour against WCAG AA and AAA, and get a corrected colour when the pair fails. Everything runs inside this page, so the work happens on your own device rather than on a server. It is most often used for checking a colour pair before committing it to a design system. For a second version of this contrast checker, see FreeToolsWorld.org.

How to use it

  1. Enter your text colour and your background colour.
  2. Set the size and weight the text will actually be used at.
  3. Read the ratio and the pass or fail for each level.
  4. If it fails, take the suggested colour — it keeps your hue and only moves the lightness.

How it works

The contrast ratio runs from 1:1, two identical colours, to 21:1, pure black on pure white. WCAG asks for at least 4.5:1 for normal text and 3:1 for large text at AA, rising to 7:1 and 4.5:1 at AAA. Interface components and meaningful graphics need 3:1 under WCAG 2.1, which is the requirement people most often miss — a button border or an icon carries the same obligation as the words next to it.

"Large" has a specific definition and it is not what most people assume: 18pt, which is 24px, or 14pt bold, which is about 18.66px. Text at 20px regular is normal text and needs the full 4.5:1, which catches out a lot of headings that look large on screen. The page works out which category your settings fall into and tells you which threshold actually applies.

When a pair fails, the suggestion adjusts only the lightness of your text colour, keeping its hue and saturation. That matters for design: a tool that just hands back a darker grey has thrown away the designer's decision, whereas moving along the lightness axis of the same hue usually gives something that still looks like the intended colour and passes.

Two things the ratio cannot capture, worth knowing before treating a pass as the end of the matter. It says nothing about colour blindness — a red and green of identical luminance pass easily and are indistinguishable to a substantial minority of people, which is why colour alone should never carry meaning. And the formula is known to be a poor model for light text on dark backgrounds, where it tends to be more permissive than perception warrants; APCA, the algorithm being developed for a future version of WCAG, addresses that, but AA and AAA remain the standards you are measured against today.

When to use it

  • Checking a colour pair before committing it to a design system.
  • Fixing an accessibility audit finding with a minimal colour change.
  • Testing whether a brand colour can carry body text.
  • Checking placeholder, disabled and secondary text, which fail most often.

Common mistakes to avoid

  • Assuming large text means "looks big". It means 24px, or 18.66px bold, and nothing else.
  • Checking body text and forgetting icons, borders and focus rings, which need 3:1 of their own.
  • Treating a pass as proof of accessibility. Contrast is one requirement among many, and it says nothing about colour blindness.

Frequently asked questions

What contrast ratio do I need?

4.5:1 for normal text and 3:1 for large text to meet AA. AAA asks for 7:1 and 4.5:1. Interface components, icons and focus indicators need 3:1 under WCAG 2.1 regardless of text size.

What counts as large text?

18pt — that is 24px — or 14pt bold, which is about 18.66px. Text at 20px regular is still normal text and needs the full 4.5:1, which surprises people with large-looking headings.

Does passing contrast mean my colours are accessible?

No. It means they pass one specific requirement. Contrast says nothing about colour blindness, so never let colour alone carry meaning, and the formula is known to be lenient on light-on-dark combinations.

Related tools

See all developer tools →