Skip to content

WCAG Contrast Checker

Check contrast ratio for readable color combinations. Built for accessible web design.

WCAG Contrast Ratio Checker for Accessible Design

Verify that your color combinations meet WCAG standards. Test any background and text colors to ensure readable, accessible UI components and responsive layouts.

Test Your Color Combinations

Background: #FFFFFF | Text: #24172E
The quick brown fox jumps over the lazy dog.

WCAG contrast requirements

What you are checkingLevel AALevel AAA
Normal text (below about 24px, or 19px bold)4.5:17:1
Large text (24px and up, or 19px bold and up)3:14.5:1
UI components and icons (button borders, input outlines, focus rings)3:13:1

Most laws and accessibility policies point to WCAG 2.1 or 2.2 Level AA, so 4.5:1 for normal text is the number to aim for. Logos and purely decorative text have no requirement.

Contrast ratios of common colour pairs

Calculated with the WCAG formula. Use these as quick references, then test your exact colours above:

PairColoursRatioResult
Aa Mid grey text on white#767676 on #FFFFFF4.54:1AA
Aa Dark grey text on white#595959 on #FFFFFF7.00:1AAA
Aa Blue link on white#2563EB on #FFFFFF5.17:1AA
Aa White text on blue button#FFFFFF on #2563EB5.17:1AA
Aa Green text on white#16A34A on #FFFFFF3.30:1AA large text only
Aa White text on amber#FFFFFF on #F59E0B2.15:1Fails
Aa Charcoal on light grey#1F2937 on #F3F4F613.34:1AAA
Aa Red on black#FF0000 on #0000005.25:1AA

Notice that bright brand colours such as green and amber often fail with white. Darken them a few steps for text and buttons.

How the contrast ratio is calculated

WCAG compares the relative luminance (perceived brightness) of the two colours:

ratio = (L1 + 0.05) / (L2 + 0.05)

L1 is the luminance of the lighter colour and L2 of the darker one, each between 0 (black) and 1 (white). The result ranges from 1:1 (identical colours) to 21:1 (black on white). Green contributes most to luminance and blue the least, which is why a pure blue can feel darker than a pure green of the same intensity.

How to fix a colour pair that fails

  • Darken the text, not the brand. Keep your brand colour for large elements and use a darker shade of it for text.
  • Swap the roles. If white text on a light colour fails, try dark text on that colour instead.
  • Make the text larger or bolder. Large text only needs 3:1.
  • Add a solid layer behind text on images, gradients or glass effects, because the background changes from point to point.

Frequently asked questions

What is a good contrast ratio for text?

At least 4.5:1 for normal body text (WCAG AA). 7:1 or higher (AAA) is even easier to read.

Does WCAG contrast apply to buttons and icons?

Yes. Under WCAG 2.1 and later, meaningful icons and the visible boundaries of buttons and form fields need at least 3:1 against what is next to them.

Is grey text on white accessible?

Only if it is dark enough. #767676 on white is about 4.54:1, just above the AA line. Anything lighter fails for normal text.

Does contrast matter for SEO?

Not as a direct ranking signal, but readable text keeps people on the page and Lighthouse reports low contrast as an accessibility issue.

Can I check contrast for text on a gradient or image?

Test the text colour against the lightest and darkest parts of the background. If either fails, add a darker overlay or a solid background behind the text.

Related tools