Accessibility

WCAG Contrast Checker

Paste a foreground and background color, see the exact contrast ratio, and preview how real text looks at body and heading sizes.

Short answer

WCAG AA requires 4.5:1 for normal text and 3:1 for large text. AAA requires 7:1 and 4.5:1. Enter both colors to see whether a pair passes, and switch the foreground to black or white if it does not.

Two color fields with measured contrast ratios and AA and AAA pass labels for body and large text

Live checker

Check any text and background pair

WCAG thresholds: AA 4.5:1 normal and 3:1 large; AAA 7:1 normal and 4.5:1 large.

WCAG 2.2

Large heading at 24px bold

Normal body copy at 16px. This is the size most people read, and the size most palettes fail.

Small label at 14px
Contrast ratio7.39:1
AA normalPass
AA largePass
AAA normalPass
AAA largePass

The thresholds that matter

WCAG 2.2 defines contrast minimums for text and images of text. For AA, normal text needs at least 4.5:1 and large text needs at least 3:1. For AAA, the targets rise to 7:1 and 4.5:1.

Large text is usually defined as at least 18 point (24 CSS pixels) regular weight, or 14 point (about 18.66 CSS pixels) bold. The exact threshold depends on the font and weight, so when in doubt, use the stricter normal-text rule.

These are minimums for compliance. A ratio of 4.5:1 can still feel weak for a long paragraph, especially on a bright screen. Many teams aim higher for body copy.

TextAAAAA
Normal text4.5:17:1
Large text3:14.5:1
UI components and graphics3:1Not defined by AA/AAA text rules

Normal text vs large text

A heading can pass at 3:1 while the paragraph below it fails at 3:1. That is why the checker reports both thresholds. A palette that only works for large display type is not a body-text palette.

The distinction is based on size and weight, not on the element name. An `<h3>` rendered at 14 pixels is not large text just because it is a heading.

When a design uses very light font weights, the perceived contrast drops even if the measured ratio passes. Thin text at 4.5:1 can be harder to read than regular text at 4.5:1. Consider the weight in the final review.

How the ratio is calculated

The contrast ratio compares the relative luminance of two colors. Luminance is calculated from the linearized RGB channels, weighted by human sensitivity to red, green and blue. The ratio is `(L1 + 0.05) / (L2 + 0.05)`, where L1 is the lighter color.

Because the formula uses relative luminance, two colors can look similar in hue and still have very different ratios. A saturated blue and a dark gray may look different but have similar luminance; a light pink and a white may look similar but have a low ratio.

The checker uses the same sRGB luminance formula as the WCAG specification. It does not simulate color blindness or display calibration, which are separate checks.

What to do when a pair fails

First, try black or white text. If either passes, you have a safe fallback without changing the background. The checker includes a one-click switch for both.

If neither passes, adjust the background. Darkening a light background or lightening a dark background usually increases the ratio. Be careful not to lose the brand feel in the process.

If the background must stay, consider a darker or lighter variant of the brand color for text and buttons. The original color can remain as a decorative surface or a large graphic.

  • Try black text on the current background.
  • Try white text on the current background.
  • Adjust the background lightness.
  • Use a darker or lighter brand variant for text.
  • Keep the original color for decoration, not body copy.

Contrast is not the only accessibility check

A page can pass every contrast check and still be inaccessible. Keyboard navigation, focus visibility, form labels, error messages, motion preferences, touch target size and screen-reader semantics all matter.

Color should not be the only way to communicate state. A red error message should also have an icon or a text label. A green success state should not rely on hue alone.

Use the contrast checker as one gate in a larger review. It is a fast, objective check that catches a common class of failures, not a complete accessibility audit.

FAQ

WCAG Contrast Checker FAQ

What contrast ratio does WCAG AA require?

4.5:1 for normal text and 3:1 for large text. AAA raises those to 7:1 and 4.5:1.

What counts as large text?

Generally 18 point (24 CSS pixels) regular weight or 14 point (about 18.66 CSS pixels) bold. When in doubt, use the normal-text threshold.

Does this checker test color blindness?

No. It measures luminance contrast. Color-blindness simulation and non-color cues are separate accessibility checks.

Can I check a button color?

Yes. Use the button text color as the foreground and the button background as the background. For UI components, 3:1 is the common minimum, but text inside the button still needs the text threshold.

Why does a color pair pass here but fail in another tool?

Check that both tools use the same sRGB values and the same large-text definition. Rounding and color-space conversion can also produce small differences.