Tools / Color Contrast Checker (WCAG)

Color Contrast Checker (WCAG).

Check text and UI color contrast against WCAG 2.2 AA and AAA, with the closest passing colors.

Runs in your browser

Ctrl/⌘ + Enter to run · Ctrl/⌘ + Shift + C to copy the result

Result
Contrast
Preview
WCAG checks
Closest passing colors

About Color Contrast Checker (WCAG)

The Color Contrast Checker measures how readable a text color is on a background using the WCAG 2.x contrast formula, the one accessibility audits and Lighthouse use. Pick a text color and a background and you get the ratio, from 1:1 for identical colors to 21:1 for black on white, and a pass or fail for each success criterion: 4.5:1 for normal text and 3:1 for large text at level AA, 7:1 and 4.5:1 at level AAA, and 3:1 for icons, input borders and other user interface components. The preview renders a heading, body text, a small caption and an outlined button in your colors so you can see the result, not only the number. When a pair fails, the tool suggests the closest text color and the closest background color that reach AA and AAA, keeping the same hue in the OKLCH color space so your brand color stays recognisable. For example, Tailwind gray-500 (#6b7280) on gray-100 (#f3f4f6) gives about 4.39:1, just short of AA, and a slightly darker gray fixes it. Ratios are truncated rather than rounded, because 4.499:1 does not meet 4.5:1. Common mistakes are checking only the brand color and not placeholder or disabled text, forgetting hover and focus states, and relying on color alone to convey meaning. Semi-transparent colors are composited before measuring. Everything runs in your browser.

How to Use

  1. Choose the text color and the background color.
  2. Read the ratio and the AA / AAA results; the preview updates live.
  3. If it fails, copy one of the suggested colors that pass.

Frequently Asked Questions

What counts as large text?

WCAG defines large text as at least 24 CSS pixels regular or 18.66 CSS pixels (14pt) bold. Large text needs 3:1 for AA instead of 4.5:1.

Why is my 4.49:1 pair marked as a fail?

The thresholds are minimums. The ratio is truncated to two decimals before comparing, so anything below 4.5 fails AA for normal text.

Does this check APCA from WCAG 3?

No. It uses the WCAG 2.x relative luminance formula, which is what current laws and audits reference. APCA is still a draft.

Is anything sent to a server?

No. The calculation and the preview are generated in your browser.

Related Tools