Color contrast checker

Enter a text color and a background color to see the WCAG contrast ratio and which AA and AAA levels pass. If they fail, you get the closest color that passes, for the text or the background.

Everything runs in your browser. Your text and files stay on your device and are never uploaded.

Hex, rgb(), hsl() and common color names work. Add alpha (#rrggbbaa or rgba) and the text is blended over the background first.

Large text sample, 24px

Body text sample at 16px. The quick brown fox jumps over the lazy dog.

UI element

4.54:1 contrast ratio, passes AA for body text

  • Pass AA normal text (4.5:1)
  • Pass AA large text, 24px or 18.66px bold (3:1)
  • Pass AA icons, borders, focus rings (3:1)
  • Fail AAA normal text (7:1)
  • Pass AAA large text (4.5:1)

Nearest passing colors for AA body text (4.5:1)

These colors already meet AA body text (4.5:1). No change needed.

How to use it

  1. Type a text color and a background color as hex, rgb(), hsl() or a color name, or use the pickers.
  2. Read the ratio and the pass or fail list for body text, large text, UI parts and AAA.
  3. Choose the level you need under Fix to reach. Body text on a normal page needs AA at 4.5:1.
  4. If it fails, compare the two suggestions. One changes the text color, the other the background. Each keeps the hue.
  5. Press Use it to try a suggestion in the preview, or Copy hex and paste it into your Webflow style panel.

WCAG contrast thresholds

ContentAAAAA
Body text under 24px (or 18.66px bold)4.5:17:1
Large text, 24px or 18.66px bold and up3:14.5:1
Icons, input borders, focus indicators3:1no AAA rule
Logos and disabled controlsexemptexempt

Questions

What contrast ratio does WCAG AA require?

WCAG 2.2 AA asks for 4.5:1 for normal text and 3:1 for large text, which means 24px, or 18.66px when bold. Icons, input borders and focus indicators also need 3:1 against what is next to them.

What is the difference between AA and AAA contrast?

AAA is stricter: 7:1 for normal text and 4.5:1 for large text. Most legal and procurement rules ask for AA. Use AAA for long reading text or when your audience has low vision.

How is the nearest passing color chosen?

The tool keeps the hue and saturation and moves only the lightness, in whichever direction needs the smaller change, until the ratio reaches your target. The result stays close to your brand color.

How does it handle transparent colors?

Add an alpha value, as in #1a1a1a99 or rgba(26, 26, 26, 0.6). The text color is blended over the background first, and a transparent background is blended over white, so the ratio matches what a visitor sees.

Does text over an image or gradient work?

Check the text against the lightest and the darkest part of the image behind it, and make sure both pass. A semi-transparent dark layer between the image and the text is a common fix.

Are my colors sent anywhere?

No. The math runs in your browser and nothing is uploaded or stored.

Sources

More free tools

All free tools