Skip to content

WCAG Contrast Checker

Embed

Paste this where you want WCAG Contrast Checker on your site. Adjust the height to fit.

<iframe src="https://www.browserutils.dev/embed/wcag-contrast-checker/" width="100%" height="500" frameborder="0" loading="lazy" title="WCAG Contrast Checker"></iframe>
<p style="font-size:12px;margin:4px 0 0"><a href="https://www.browserutils.dev/tools/wcag-contrast-checker/">WCAG Contrast Checker</a> by BrowserUtils</p>

Check WCAG 2.1 color contrast ratios.Runs in this tab.

Large Text Sample (18pt+)

Normal text sample — The quick brown fox jumps over the lazy dog.

Small text for detailed reading and interface elements.

17.06:1

Contrast Ratio

PASS — AA Normal Text (4.5:1)
PASS — AA Large Text (3:1)
PASS — AAA Normal Text (7:1)
PASS — AAA Large Text (4.5:1)

How to use WCAG Contrast Checker

  1. Set Foreground (Text) and Background with the hex fields or the color pickers. The page opens on #1a1a2e and #ffffff.
  2. Read Contrast Ratio and the four rows: AA Normal Text (4.5:1), AA Large Text (3:1), AAA Normal Text (7:1), and AAA Large Text (4.5:1).
  3. Click Swap Colors to flip the pair. The preview labels the large sample as "Large Text Sample (18pt+)".

Contrast pairs this checker measures

The ratio uses the WCAG 2 relative luminance formula. WCAG 2.1 and 2.2 use those same numbers for text. The page checks text contrast only.

The default pair

Foreground #1a1a2e on background #ffffff is 17.06:1.

Check Threshold Result
AA Normal Text 4.5:1 Pass
AA Large Text 3:1 Pass
AAA Normal Text 7:1 Pass
AAA Large Text 4.5:1 Pass

Gray on white, just under 4.5:1

#777777 on #ffffff is 4.48:1.

Check Threshold Result
AA Normal Text 4.5:1 Fail
AA Large Text 3:1 Pass
AAA Normal Text 7:1 Fail
AAA Large Text 4.5:1 Fail

#767676 on #ffffff is 4.54:1 and passes AA Normal. The two grays look almost the same. The 4.5:1 line is between them.

White text on a blue button

#FFFFFF on #0B5FFF is 5.13:1. That passes AA Normal and AA Large. It fails AAA Normal, which needs 7:1. Swap Colors flips the pair and the ratio stays 5.13:1, because the formula uses the lighter and darker luminance, not which field you typed first.

Large text in the preview is labeled “Large Text Sample (18pt+)”. That matches the WCAG large-text size: 18pt, or 14pt bold. The checker does not apply the 3:1 rule for non-text UI parts, and it does not use APCA or WCAG 3. Colors are hex.

Next step

Questions

What contrast ratio does WCAG AA require?
AA Normal Text needs 4.5:1. AA Large Text needs 3:1. Large text here is the WCAG size, 18pt or 14pt bold, which the preview calls "Large Text Sample (18pt+)".
What is the difference between WCAG AA and AAA?
AAA Normal Text needs 7:1. AAA Large Text needs 4.5:1. #FFFFFF on #0B5FFF is 5.13:1, so it passes AA Normal and fails AAA Normal.
Why does #777777 on white fail a color / colour contrast check?
#777777 on #ffffff is 4.48:1. That fails AA Normal (4.5:1) and AAA Large (4.5:1), and it passes AA Large (3:1). #767676 on #ffffff is 4.54:1 and passes AA Normal. Gray on white can look fine and still miss 4.5:1.
Does this check WCAG 2.2 non-text contrast?
It checks text contrast only, using the WCAG 2 relative luminance formula (the same numbers WCAG 2.1 and 2.2 use for text). It does not check the 3:1 non-text UI contrast rule, and it does not use APCA or WCAG 3.

More in Accessibility

All 8 accessibility