PUBLIC.INTERNET

WCAG Color Contrast Checker

Choose a foreground and a background color and the page computes the WCAG contrast ratio between them. Four cards then mark AA and AAA as pass or fail for normal and large text, and a live preview shows your pairing at heading, body, and small sizes. It is a quick check for a button, a link color, or a brand palette before you commit it to CSS. Colors are entered as hex codes (3 or 6 digits) or with the color picker.

Live Preview

Large sample, 36px bold

The quick brown fox jumps over the lazy dog (18px, normal size)

Small text example (14px)

Contrast Ratio

21.00:1

Contrast 21.00:1. Passes AA and AAA for normal and large text.

Normal Text (AA)

Minimum 4.5:1

Pass

Normal Text (AAA)

Minimum 7:1

Pass

Large Text (AA)

Minimum 3:1

Pass

Large Text (AAA)

Minimum 4.5:1

Pass

Quick Reference

  • Normal text: anything smaller than large text.
  • Large text: at least 24px (18pt), or at least 14pt (about 18.67px) when bold.
  • AA: the level most accessibility policies and laws point to.
  • AAA: an enhanced level, not required for whole sites.

How to check a color pair

  1. Set the Text color with the swatch picker or by typing a hex code such as #1a1a1a into the box beside it. Three or six digits work, with or without the #.
  2. Set the Background color the same way. The preview panel repaints with your text color on your background as soon as the value is valid, and an invalid hex is marked with a message instead of being ignored.
  3. Read the ratio shown next to Contrast Ratio, shown to two decimals and rounded down (for example 4.62:1), so the number never looks like a pass when the pair fails.
  4. Check the four cards. Each is marked Pass when the pair meets its minimum (4.5:1 and 7:1 for normal text at AA and AAA, 3:1 and 4.5:1 for large text) and Fail when it does not. A line under the ratio sums up the levels reached.
  5. Press Swap colors to test the reverse pairing, such as light text on a dark background.

How the ratio is calculated, and what a pass does not cover

WCAG defines contrast from relative luminance, not from how bright a color looks in a picker. Each sRGB channel is linearized (values at or below 0.04045 divide by 12.92, others use ((c + 0.055) / 1.055) raised to 2.4), then weighted 0.2126 red, 0.7152 green, 0.0722 blue. The ratio is (lighter + 0.05) / (darker + 0.05). That is why pure red and pure blue, both 50% lightness in HSL, score 3.99:1 and 8.59:1 against white, and why green carries so much of the result.

Pass and fail use the exact ratio, and the display rounds down, so #006ffb on white shows 4.49:1 and fails AA even though it is 4.4999:1. Large text means at least 18pt (24px) or at least 14pt bold (about 18.67px); everything smaller is normal text. The checker also tests solid colors only. It cannot judge text over a photo or gradient, anti-aliasing at tiny sizes, or non-text elements such as icons and focus rings, which WCAG 2.1 holds to 3:1. Treat it as the arithmetic step, then check real renderings.