Skip to content

Color contrast calculator (WCAG accessibility)

Calculate the contrast ratio between two colors and see if it passes WCAG accessibility criteria.

Contrast ratio
7.46 : 1
AA normal text (≥ 4.5)✓ pass
AA large text (≥ 3)✓ pass
AAA normal text (≥ 7)✓ pass

WCAG requires 4.5:1 for normal text (AA) and 7:1 for AAA. Large text (≥18pt or 14pt bold) needs 3:1.

Guide Color contrast and accessibility (WCAG)

How the calculation works

The relative luminance of each color is computed (from RGB, with gamma correction) and the contrast ratio (L_light + 0.05) ÷ (L_dark + 0.05). The result ranges from 1:1 (identical) to 21:1 (black and white).

Examples

  • Black (#000) on white (#fff): 21:1 (the maximum).
  • Light gray #999 on white: ~2.8:1 → fails AA for normal text.

Frequently asked questions

What minimum contrast should I use?

Aim for 4.5:1 for normal text (level AA). For maximum legibility, 7:1 (AAA).

Does large text need less contrast?

Yes: from 18 pt (or 14 pt bold), the AA minimum drops to 3:1.

Why does contrast matter?

Low contrast is hard to read for low-vision users — and for everyone in bright sun or on poor screens. It is a WCAG accessibility requirement.

Related calculators

More Tech / IT calculators

See all →

Updated on June 30, 2026 · by Rafael Rossi · Methodology & sources