WCAG Color Contrast Checker

Test foreground and background color pairs against WCAG 2.1 accessibility benchmarks to ensure digital compliance.

Evaluated locally WCAG 2.1 standards
HEX
HEX
Colors evaluated locally

Large Heading Text (18pt+)

This is regular body text. Readable contrast ensures your website complies with legal accessibility standards (ADA in the US, Equality Act in the UK).

WCAG 2.1 compliance

21.00 : 1 contrast
  • Normal text (WCAG AA ≥ 4.5:1)Pass
  • Normal text (WCAG AAA ≥ 7.0:1)Pass
  • Large text (WCAG AA ≥ 3.0:1)Pass
  • Large text (WCAG AAA ≥ 4.5:1)Pass
  • UI components & icons (≥ 3.0:1)Pass

WCAG 2.1 Level AA is the legal benchmark for web accessibility across government and commercial websites.

WCAG contrast levels

The Web Content Accessibility Guidelines (WCAG) set minimum contrast ratios between text and its background, so that people with low vision or colour blindness can read it:

LevelRatio neededWhere it applies
AA, normal text4.5 : 1Body text, captions, labels and text in input boxes.
AA, large text3 : 1Text at least 18pt (24px), or bold text at least 14pt (about 18.7px).
AAA, normal text7 : 1The stricter level, for the easiest reading.
AAA, large text4.5 : 1Large text at the stricter level.
Parts of the page you use3 : 1Input borders, button outlines, focus rings and icons that carry meaning.

Most websites aim for level AA.

How the contrast ratio is calculated

For each of red, green and blue: c = value ÷ 255 c = c ÷ 12.92 if c ≤ 0.03928 c = ((c + 0.055) ÷ 1.055) ^ 2.4 otherwise Luminance (L) = 0.2126 × R + 0.7152 × G + 0.0722 × B Contrast ratio = (L1 + 0.05) ÷ (L2 + 0.05) L1 = the lighter colour, L2 = the darker colour

The ratio goes from 1:1 (the same colour twice) to 21:1 (black on white). Green counts for most of the brightness because our eyes are most sensitive to it.

Worked examples

#000000 on #ffffff 21 : 1 passes everything #777777 on #ffffff 4.48 : 1 fails AA for normal text, passes for large text #767676 on #ffffff 4.54 : 1 passes AA for normal text

The two greys look almost the same, but only the darker one passes AA for body text. That's why it's worth checking the numbers instead of trusting your eyes.

How to fix a colour that fails

  • Darken the text or lighten the background (or the other way round on a dark background) until the ratio passes. Small changes are often enough.
  • Make the text bigger or bold if it's a heading. Large text only needs 3:1 for AA.
  • Check every state, not just the normal one: links, hover and focus colours, disabled buttons that still need to be read, and placeholder text.
  • Check text on pictures against the lightest and darkest parts of the picture behind it, or add a solid background behind the text.
  • Don't use colour alone to show meaning, such as red for an error. Add words or an icon too.

Frequently asked questions

Do I have to meet WCAG?

WCAG is the standard most accessibility rules and guidance point to, and level AA is the usual target. Whether it's a legal requirement for your website depends on your country and what kind of organisation you are, so check the guidance that applies to you. Either way, good contrast makes your site easier for everyone to read, for example on a phone in bright sunlight.

Do logos need to pass?

No. WCAG makes an exception for logos and brand names, and for text that's purely decorative or part of a picture that isn't meant to be read.

What about dark mode?

Check both themes. A colour that passes on a white background can fail on a dark one, so test each pair of text and background colours you actually use.

Source: W3C: Web Content Accessibility Guidelines (WCAG) 2.2.

Keep going

Related tools

All Developer tools

Disclaimer: results are estimates for planning only and are not tax, legal or financial advice. Rules and rates vary by country, state and personal situation. Check with a qualified accountant before making decisions. Read the full disclaimer.

Last updated: