Color Contrast Checker

Check WCAG colour contrast between text and background: the exact relative-luminance ratio plus AA and AAA pass/fail for normal and large text.

Loading calculator…

What this tool does

Check WCAG colour contrast between text and background: the exact relative-luminance ratio plus AA and AAA pass/fail for normal and large text. Hex colours only (#RGB or #RRGGBB), fully opaque. AA requires 4.5:1 (normal text) / 3:1 (large); AAA requires 7:1 / 4.5:1. Large text is at least 18pt, or 14pt bold.

How to use the Color Contrast Checker

  1. Enter or select text colour (hex).
  2. Enter or select background colour (hex).
  3. Read the calculated result; change any measurement to compare alternatives.

Formula

Per WCAG 2.x: linearise each sRGB channel (c/12.92 if c <= 0.03928, else ((c+0.055)/1.055)^2.4); L = 0.2126R + 0.7152G + 0.0722B; ratio = (Llight + 0.05) / (Ldark + 0.05).
foreground
Text colour (hex)
background
Background colour (hex)

Hex colours only (#RGB or #RRGGBB), fully opaque. AA requires 4.5:1 (normal text) / 3:1 (large); AAA requires 7:1 / 4.5:1. Large text is at least 18pt, or 14pt bold.

Worked example

For color contrast checker, the following measurements illustrate the exact method: Text colour (hex): #000000; Background colour (hex): #ffffff.

Inputs

  • Text colour (hex)#000000
  • Background colour (hex)#ffffff

Result

  • Contrast ratio21
  • Text luminance0
  • Background luminance1
  • WCAG AA — normal text (4.5:1)Pass
  • WCAG AA — large text (3:1)Pass
  • WCAG AAA — normal text (7:1)Pass
  • WCAG AAA — large text (4.5:1)Pass

Results explained

Contrast ratio
Contrast ratio from the formula above. Hex colours only (#RGB or #RRGGBB), fully opaque. AA requires 4.5:1 (normal text) / 3:1 (large); AAA requires 7:1 / 4.5:1. Large text is at least 18pt, or 14pt bold.
Text luminance
Text luminance from the formula above. Hex colours only (#RGB or #RRGGBB), fully opaque. AA requires 4.5:1 (normal text) / 3:1 (large); AAA requires 7:1 / 4.5:1. Large text is at least 18pt, or 14pt bold.
Background luminance
Background luminance from the formula above. Hex colours only (#RGB or #RRGGBB), fully opaque. AA requires 4.5:1 (normal text) / 3:1 (large); AAA requires 7:1 / 4.5:1. Large text is at least 18pt, or 14pt bold.
WCAG AA — normal text (4.5:1)
WCAG AA — normal text (4.5:1) from the formula above. Hex colours only (#RGB or #RRGGBB), fully opaque. AA requires 4.5:1 (normal text) / 3:1 (large); AAA requires 7:1 / 4.5:1. Large text is at least 18pt, or 14pt bold.
WCAG AA — large text (3:1)
WCAG AA — large text (3:1) from the formula above. Hex colours only (#RGB or #RRGGBB), fully opaque. AA requires 4.5:1 (normal text) / 3:1 (large); AAA requires 7:1 / 4.5:1. Large text is at least 18pt, or 14pt bold.
WCAG AAA — normal text (7:1)
WCAG AAA — normal text (7:1) from the formula above. Hex colours only (#RGB or #RRGGBB), fully opaque. AA requires 4.5:1 (normal text) / 3:1 (large); AAA requires 7:1 / 4.5:1. Large text is at least 18pt, or 14pt bold.
WCAG AAA — large text (4.5:1)
WCAG AAA — large text (4.5:1) from the formula above. Hex colours only (#RGB or #RRGGBB), fully opaque. AA requires 4.5:1 (normal text) / 3:1 (large); AAA requires 7:1 / 4.5:1. Large text is at least 18pt, or 14pt bold.

Frequently asked questions

4.5:1 for normal text and 3:1 for large text (18pt+, or 14pt+ bold). AAA, the stricter level, requires 7:1 and 4.5:1 respectively.

21:1 — the maximum possible ratio, since black has luminance 0 and white has luminance 1: (1 + 0.05) / (0 + 0.05) = 21.

Each sRGB channel is linearised (gamma-decoded), then combined as L = 0.2126R + 0.7152G + 0.0722B, weighting green most because human vision is most sensitive to it. The ratio adds 0.05 to both sides to model ambient light.

No. Contrast is one WCAG criterion; font size, weight, spacing and not relying on colour alone also matter. This checker covers the ratio criteria (1.4.3 and 1.4.6) only.

Rounding. This tool rounds the final ratio to two decimals from full-precision luminance; the pass/fail verdicts use the unrounded thresholds as specified.