Color contrast checker — WCAG AA/AAA

Check the contrast between a foreground color and a background color against the WCAG 2.1 success criteria — entirely in your browser. Enter two colors as hex, RGB, or HSL (or use the color pickers), and you get the contrast ratio plus pass or fail verdicts for normal text, large text, and UI components. No sign-up, no uploads.

Private by default: the contrast math runs entirely in your browser tab. Your colors are never sent to a server, logged, or stored.

Check contrast

Hex, rgb(), hsl(), or a color name — e.g. #336699, rgb(51, 102, 153), hsl(210, 50%, 40%), navy.

The color the text sits on — usually a page or panel background.

Ready — checking #767676 on #ffffff.

Contrast ratio

4.54 : 1

Sample text 16px Sample text 24px
Normal text (AA ≥ 4.5, AAA ≥ 7)
AA
Large text (AA ≥ 3, AAA ≥ 4.5)
AAA
UI components (≥ 3, WCAG 1.4.11)
Pass

How it works

Three steps, all computed in this tab:

  1. Parse both colors. Hex, rgb()/rgba(), and hsl()/hsla() inputs (comma or modern space syntax) and common color names are converted to sRGB channels. Out-of-range values are clamped the way CSS clamps them.
  2. Compute relative luminance. Each channel is linearized (the WCAG sRGB formula) and weighted: L = 0.2126 R + 0.7152 G + 0.0722 B. Pure white is 1.0, pure black is 0.
  3. Divide for the ratio. (Lighter + 0.05) ÷ (Darker + 0.05), rounded to two decimals, then compared against the WCAG 2.1 thresholds: AA 4.5:1 / AAA 7:1 for normal text, AA 3:1 / AAA 4.5:1 for large text, and 3:1 for UI components and graphics (1.4.11).

Worked example: #767676 (a medium gray) on white has a relative luminance of about 0.18, so the ratio is (1.05) ÷ (0.18 + 0.05) ≈ 4.54:1 — it passes AA for normal text (≥ 4.5) and AAA for large text (≥ 4.5), but falls short of AAA for normal text (needs 7). A lighter gray like #999999 on white is only ≈ 2.85:1 and fails even the large-text threshold (needs 3) — the kind of pair that looks fine on a bright screen but fails an accessibility review.

When do you need a contrast checker?

Limits

Frequently asked questions

What is a good contrast ratio?

For web content, WCAG 2.1 defines the targets: Level AA needs 4.5:1 for normal text and 3:1 for large text (and for UI components and graphics under 1.4.11). Level AAA needs 7:1 for normal text and 4.5:1 for large text. A ratio of 21:1 (black on white) is the maximum possible. Higher is always better — these are minimums, not targets to aim exactly at.

What is the difference between WCAG AA and AAA?

AA is the common conformance level most sites and products aim for — it is the usual legal and procurement bar (for example for many public-sector and enterprise requirements). AAA is a stricter level that is harder to satisfy across an entire site, especially with large color palettes. This checker reports both so you can see how close a pair is to each level.

How is the contrast ratio calculated?

The checker converts each color to its WCAG relative luminance L using the sRGB linearization, then applies the formula (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter of the two colors. The result is rounded to two decimals, exactly like the standard WCAG examples (black on white = 21:1, pure red on white = 4:1).

What counts as "large text"?

WCAG defines large text as at least 18 point (about 24 px) regular weight, or at least 14 point (about 18.66 px) bold. Large text needs less contrast (AA 3:1, AAA 4.5:1) because thicker letterforms are easier to read at the same ratio.

Does this contrast checker upload my colors?

No. This is a static page — the contrast math runs entirely in your browser tab, and the colors you enter are never sent to a server, logged, or stored.

Why does my screen show a different color than my hex value?

Screens differ: display calibration, color profiles, and ambient light all change how a color appears. The WCAG math here uses the standard sRGB color space that the web assumes, so the numbers are the ones used for compliance checks — but if your monitor is heavily calibrated, the on-screen appearance can differ from the calculation.

Part of Local Toolworks. Last reviewed: 2026-08-17.