Free tool · WCAG color contrast

Free color contrast checker for WCAG AA and AAA

Put in a text color and a background color. You’ll get the contrast ratio, a pass or fail for every WCAG contrast rule, and a preview of real text and a button in those colors. If it fails, I’ll show you the nearest color that passes.

A hex code like #1a1a1a, or rgb(26, 26, 26)

A hex code like #1a1a1a, or rgb(26, 26, 26)

Result

17.4:1 contrast ratio for #1a1a1a on #ffffff

WCAG contrast checks for these two colors
CheckNeedsResult
AA Normal text4.5:1Pass
AA Large text3:1Pass
AAA Normal text7:1Pass
AAA Large text4.5:1Pass
AA Buttons, icons and form borders3:1Pass

Preview

Normal text at 16 pixels. This is what most paragraphs on a page look like.

Large text at 24 pixels

Bold large text at about 18.66 pixels

The button and the icon in the preview are pictures, not working controls. They show how a border and a line icon look in your text color.

What a pass means: one pair of colors meets one rule. It doesn’t make a page accessible or compliant on its own. Contrast is one part of WCAG, and a page can pass every contrast check and still be hard to use.

What contrast ratio means

Contrast ratio compares how light two colors are. It runs from 1:1, the same color twice, to 21:1, black on white. The math only looks at lightness, so two colors with very different hues can still be hard to tell apart.

The W3C says people with low vision often have trouble reading text that doesn’t stand out from its background. Color blindness can make that worse, because it lowers the contrast some people see even further. It helps everyone else too: anyone reading a phone in bright sunlight, and older people whose eyes are changing.

One detail trips people up. The W3C says the number isn’t rounded, so 4.499:1 doesn’t meet 4.5:1. This checker cuts the ratio down to two decimals and never rounds it up. Medium gray #777777 on white comes out at 4.47:1 and fails. One step darker, #767676 reaches 4.54:1 and passes.

The three WCAG rules this checks

What counts as large text

Large text is 18 point or bigger, or 14 point bold or bigger. On a web page that’s about 24 pixels, or about 18.66 pixels if it’s bold. Headings often qualify. Body text almost never does, so plan on 4.5:1 for paragraphs.

How the suggestions work

When a pair fails, I keep your text color’s hue and saturation and only move its lightness. I step it darker and lighter in small steps and stop at the first color that reaches 4.5:1, then do the same for 7:1. You get the closest passing shade each way, when one exists, and one click puts it in.

Fixing a color is usually one line in a stylesheet. Finding every place it’s used is the real work. I wrote up how to fix low contrast across a whole site.

Straight answers

What contrast ratio do I need?

For WCAG level AA, normal text needs 4.5:1 and large text needs 3:1. Level AAA asks for more: 7:1 for normal text and 4.5:1 for large text. Buttons, form borders and icons people need to see need 3:1 against the colors next to them.

What counts as large text?

18 point or larger, or 14 point bold or larger. On a web page that's about 24 pixels, or about 18.66 pixels in bold. Large text is easier to read, so it gets a lower bar.

Why does 4.49:1 fail when it's so close to 4.5:1?

Because the W3C says not to round. A ratio of 4.499:1 doesn't meet 4.5:1. So this checker cuts the number down to two decimals and never rounds it up, and the pass or fail always matches the number you see.

Do logos and disabled buttons have to pass?

No. WCAG has no contrast requirement for text in a logo, for decoration, or for a control that's switched off. Text that's part of a photo or picture full of other detail is exempt too. Most other text people need to read has to pass.

If my colors pass, is my website accessible?

Not on that alone. A pass means one pair of colors meets one rule. Contrast is one of many things WCAG covers, and a page can pass every contrast check and still be hard to use with a keyboard or a screen reader.

Does this send my colors anywhere?

No server does the math. The check runs in your browser, and the two colors are kept in the page address so you can share a link to them.

Check a whole page

This checks two colors you already know about. My free accessibility check scans an entire page for low contrast and the other problems automated testing can find, in about half a minute.

Check a whole page

Want someone to find and fix it for you? Tell me about your site.

Sources

All checked on November 8, 2026.