Color Contrast Checker

Free color contrast checker for web accessibility. Test WCAG 2.1 compliance for text and background color combinations. Ensure your designs are accessible to all users.

Free online tool · Developer Tools · No installation · No sign-up required

Worked example

The brand teal #0D7377 on white against all four WCAG levels

A brand colour is about to be used for body text on a white background, and the palette has to be signed off knowing which WCAG levels it reaches.

  1. Enter #0D7377 as the foreground and #FFFFFF as the background. The colour is read as red 13, green 115 and blue 119.
  2. Each channel is divided by 255 and linearised with the WCAG curve. Red: 13/255 = 0.0510, which is 0.004025. Green: 115/255 = 0.4510, which is 0.171441. Blue: 119/255 = 0.4667, which is 0.184475.
  3. Relative luminance is 0.2126 x 0.004025 + 0.7152 x 0.171441 + 0.0722 x 0.184475 = 0.136789. White is 1.0.
  4. The ratio is (1.0 + 0.05) divided by (0.136789 + 0.05) = 5.62 to 1, which the panel prints as 5.62:1.
  5. Reading the four rows: AA normal text needs 4.5 and passes, AA large text needs 3 and passes, AAA large text needs 4.5 and passes, AAA normal text needs 7 and fails.
  6. For calibration, #767676 on white gives 4.54 to 1, the classic grey that just clears AA normal text, and #595959 gives 7.00 to 1, which clears AAA.
  7. Taking the teal darker to #0A5C5F raises the ratio to 7.75 to 1, which passes AAA normal text as well and keeps the hue.

Result: At 5.62 to 1 the teal is safe for large text at every level and passes AA for body text, but it fails AAA for normal text. Darkening it to about #0A5C5F reaches 7.75 to 1 and passes all four rows, at the cost of a visibly darker brand colour.

How to use Color Contrast Checker

  1. Enter foreground color
  2. Enter background color
  3. View contrast ratio
  4. Check WCAG AA/AAA compliance
  5. Adjust colors to meet standards

Common mistakes

Checking a text colour that is semi-transparent in the real design.

Alpha is composited before the maths: a translucent foreground is flattened onto the background, and a translucent background is first flattened onto white because nothing else is behind it here. If the page has a photo or a coloured block behind the text, the ratio shown is not the ratio users see, and the result says so when alpha is involved.

Treating every heading as large text.

WCAG 2.1 defines large text as at least 18pt (24px), or at least 14pt (18.66px) when bold. A 20px heading is normal text for this purpose and needs 4.5 to 1, not 3 to 1.

Checking one colour pair and applying the verdict to the whole design system.

A ratio belongs to a pair of colours, not to a colour. Check hover, focus, disabled, placeholder and dark-mode pairs separately, because a teal that passes on white can fail on a light grey card.

Typing a colour name such as teal or a system keyword.

Only hex (#rgb, #rgba, #rrggbb, #rrggbbaa), rgb() and rgba() and hsl() and hsla() are parsed, in comma or space syntax, with percentages and a slash before alpha. Anything else returns an error naming the accepted forms rather than silently failing.

Features

Limits worth knowing

When to use it

Practical tips

When this is not the right tool

Frequently asked questions

What is WCAG?

Web Content Accessibility Guidelines — international standards for making web content accessible to people with disabilities.

What ratio do I need?

AA requires 4.5:1 for normal text and 3:1 for large text. AAA requires 7:1 and 4.5:1 respectively.

Why does contrast matter?

About 1 in 12 men and 1 in 200 women have color vision deficiency. Good contrast helps everyone read your content.

Related tools in Developer Tools