WCAG Color Contrast Checker

Enter a foreground and background color to instantly compute the WCAG 2.1 contrast ratio and AA/AAA pass status.

Foreground (text)
Background
:1
Normal text — Sample text 12345
Large text — Heading 24px
Bold large — Bold 18.66px
Normal text < 18pt or < 14pt bold
AA 4.5:1
AAA 7:1
Large text ≥ 18pt or ≥ 14pt bold
AA 3:1
AAA 4.5:1
UI components Buttons, icons, borders
AA 3:1

How to Use

1
Pick two colors

Use the color pickers or enter HEX/RGB for foreground (text) and background.

2
Read the ratio

The result card shows the contrast ratio from 1:1 up to 21:1, plus a preview of how the text looks.

3
Check AA/AAA

Pass/fail flags for normal text (4.5:1, 7:1) and large text (3:1, 4.5:1) appear side by side — green for pass, red for fail.

FAQ

What are the WCAG thresholds?

WCAG 2.1: normal text needs AA 4.5:1 / AAA 7:1, large text (≥18pt or ≥14pt bold) needs AA 3:1 / AAA 4.5:1. Non-text UI components and graphical objects use a 3:1 threshold.

How is the ratio computed?

Compute relative luminance (L1, L2) for each color, then `(lighter + 0.05) / (darker + 0.05)`. The result ranges from 1:1 (identical) to 21:1 (black on white).

What about transparent colors?

WCAG ratios assume opaque colors. Use the actual composited color (foreground blended over the real background) for accurate results.

How is "large text" defined?

Text is "large" at 18pt (24px) or bolder 14pt (18.66px). Larger text passes at lower ratios.

Is anything sent to a server?

No. All computation happens in your browser; the colors never leave the page.