utilyfe

Color Contrast Checker

Check any two colors against WCAG AA and AAA, with a real text preview and a suggested fix.

Runs entirely in your browser. Nothing you enter is uploaded or stored.

#047857

#ffffff

The quick brown fox jumps over the lazy dog

Regular body text at a normal size, like this paragraph, needs the highest contrast to stay readable.

5.48:1
Normal text
Passes AA
AA needs 4.5:1, AAA needs 7:1
Large text (18pt+, or 14pt+ bold)
Passes AAA
AA needs 3:1, AAA needs 4.5:1
UI components & graphics
Passes AA
Needs 3:1

How to use the Color Contrast Checker

  1. 1Enter a text colour and a background colour, as hex, rgb(), or hsl(), or use the colour pickers.
  2. 2Read the ratio and the pass/fail badges for normal text, large text, and UI components.
  3. 3If normal text fails, press "Use this colour" to swap in the closest shade of the same hue that passes AA.
  4. 4Copy the ratio to paste into a design review or an accessibility ticket.

What the ratio means

WCAG expresses contrast as a ratio from 1:1 (no contrast: identical colors) to 21:1 (the maximum possible, pure black on pure white). It’s built from each colour’s relative luminance, how bright it appears, weighted the way the human eye actually perceives red, green and blue, not from how different the raw numbers look.

That weighting is why two colours can look similarly “different” and score very differently: pure blue (#0000FF) on white scores about 8.6:1, while pure red (#FF0000) on white scores under 4:1, because the eye is far less sensitive to blue than to red.

The thresholds

Text type AA AAA
Normal text 4.5:1 7:1
Large text (18pt+, or 14pt+ bold) 3:1 4.5:1
UI components & graphical objects 3:1 n/a

AA is the level that matters for compliance. It’s what the ADA, EN 301 549, and most accessibility audits check against. AAA is a higher bar, generally reserved for content built specifically for low-vision users.

The UI-component threshold (3:1) is a separate WCAG 2.1 requirement for things like button borders, form field outlines and icons: it’s not about text at all, but it’s easy to overlook next to the text rules.

Why transparency changes the answer

A contrast checker that only looks at the two colours you typed can be quietly wrong. If your text colour has any transparency, what a reader actually sees is that colour blended with the background behind it, and that blended colour is usually lighter or darker, and always less saturated, than the value in your CSS.

This page composites a translucent foreground onto the background you entered before scoring it, the same way a browser renders it. A rgba(255,255,255,0.5) label over a dark background is scored as the mid-grey it actually looks like, not as white.

Getting from a failing color to a passing one

When normal text fails AA, the page searches the same hue and saturation (lighter in one direction, darker in the other) for the nearest shade that clears 4.5:1, and offers whichever needs the smaller change. That keeps your brand colour recognisable rather than replacing it with an unrelated one.

Sometimes no shade of a hue reaches 4.5:1 against a very close background (a pale yellow will never contrast well against white no matter how you adjust it), and in that case changing the background, or picking a different hue, is the real fix.

A quick sanity check

Pure black text (#000000) on pure white (#ffffff) always scores 21:1 (the theoretical maximum), which is a useful way to confirm any contrast tool, including this one, is doing the maths right.

Questions

What's the actual difference between AA and AAA?
They're both from WCAG, just at different strictness. AA is the level almost every accessibility law and audit checks against: 4.5:1 for normal text, 3:1 for large text. AAA is stricter still, 7:1 and 4.5:1, and is usually reserved for content aimed specifically at low-vision readers. Meeting AA is the practical target for most sites.
What counts as "large text"?
18 point (24px) or larger at any weight, or 14 point (about 18.5px) and bold. Large text gets a lower bar: 3:1 for AA instead of 4.5:1, because bigger, heavier strokes stay legible at lower contrast. A bold 24px heading and a regular 14px paragraph are judged by different rules even in the same design.
Why does a semi-transparent color give a different ratio than the solid version?
Because what a reader actually sees is the color blended with whatever's behind it, not the raw color value. A 50% white on a dark background looks like (and is scored as) a mid-grey, not white. This page blends a translucent text colour onto the background you entered before scoring it, which is the honest number.
My colors pass here but fail in my design tool. Why?
Usually one of two reasons: your design tool is comparing against a different actual background (a semi-transparent layer, an image, a gradient) than the flat colour you tested here, or it's using an older or non-standard formula. This page uses the WCAG 2.x relative luminance formula exactly as published, which is what accessibility audits check against.
Is my color data sent anywhere?
No. Parsing, the luminance maths and the suggested colour are all computed in this browser tab. Nothing is uploaded, logged or saved.