How to Check Color Contrast for Accessibility (Complete Guide)

Learn how to check color contrast for accessibility compliance. Step-by-step guide covering WCAG ratios, tools, which elements to test, and how to fix failures free.

How to Check Color Contrast for Accessibility (Complete Guide)

Checking colour contrast for accessibility means verifying that the luminance difference between your text colour and background colour meets the WCAG minimum ratios. It sounds technical but the process is straightforward — you enter two colour codes, a tool calculates the ratio, and you get an immediate pass or fail result.

This guide covers the complete process: understanding the ratios, which elements to check, how to use a free contrast checker, how to fix failures, and how to test your full colour palette at once.

What Contrast Ratio Do You Need for Accessibility?

WCAG 2.1 Level AA — the standard referenced by ADA compliance, the European Accessibility Act, and most international accessibility laws — requires:

  1. 4.5:1 for normal text (body text, links, labels, buttons)
  2. 3:1 for large text (18pt/24px or larger, or 14pt/18.5px bold or larger)

WCAG AAA — the enhanced optional level — requires:

  1. 7:1 for normal text
  2. 4.5:1 for large text

For most websites, meeting AA is the legal requirement. AAA is best practice, recommended for healthcare, government, and financial services sites.

Step 1 — Get Your Colour Hex Codes

Before you can check contrast, you need the hex codes of your text and background colours. There are three ways to get them:

From your CSS: Open your browser developer tools (F12), click on any text element, and look for color and background-color in the Computed Styles tab. These are shown as RGB values — convert them to hex using an online RGB-to-hex converter, or use a colour picker browser extension.

From your design file: In Figma, Sketch, or Adobe XD, click any text element and the fill colour hex code appears in the right-hand properties panel.

From an existing website: Use our free website colour extractor — enter any URL and the tool extracts all colours used on that page with their hex codes.

Step 2 — Enter Your Colours into the Contrast Checker

Go to webassetsuite.com/contrast-checker.

Enter your text colour hex code in the Text Color field and your background colour in the Background Color field. The tool updates in real time — the contrast ratio and pass/fail badges appear instantly as you type or adjust the colour pickers.

Read the results:

  1. AA Normal — passes if ratio ≥ 4.5:1. Required for body text, links, labels, buttons.
  2. AA Large — passes if ratio ≥ 3:1. Required for headings 18pt+ or bold 14pt+.
  3. AAA Normal — passes if ratio ≥ 7:1. Enhanced standard for normal text.
  4. AAA Large — passes if ratio ≥ 4.5:1. Enhanced standard for large text.

Step 3 — Check Every Text/Background Combination on Your Site

One check is not enough. Every unique combination of text colour on background colour used on your website needs to pass independently. Common combinations to check:

Body text on page background Your main paragraph text colour against your page background colour. This is usually the most important check — body text at 16–18px falls under the normal text threshold (4.5:1).

Headings on page background H1 and H2 headings are often large enough (24px+) to qualify as large text (3:1 threshold). H3 and H4 at 18–22px may or may not qualify depending on their size and weight.

Link colour on background Navigation links, inline text links, and footer links all need to pass contrast against their respective backgrounds — which may be different colours (white page, dark header, grey footer).

Button text on button background The text label inside your call-to-action button against the button's background colour. Mid-tone brand colours (blues, greens, purples) commonly fail with white text.

Form labels and inputs Form field labels against the page background, placeholder text against the input background, and input text against the input background.

Error and success messages Alert text (error red, success green) against their coloured or white background.

Step 4 — Check Your Full Palette at Once (Palette Grid)

If you have multiple brand colours used across your design system, testing each pair individually is slow. Use the Palette Contrast Grid in the contrast checker:

  1. Click "Add Color" and enter all your brand colours — primary, secondary, accent, text, and background colours
  2. Click "Check All Combinations"
  3. The grid shows every possible combination's contrast ratio — colour-coded green (pass) or red (fail)

This gives you a complete picture of your colour system's accessibility in under 2 minutes.

Step 5 — Simulate Color Blindness

Contrast ratio alone does not catch all colour accessibility problems. Two colours can have sufficient contrast for sighted users but look nearly identical to users with colour vision deficiency.

Use the colourblind simulation in the contrast checker — toggle between Protanopia (red weakness), Deuteranopia (green weakness), and Tritanopia (blue weakness) to see how your live webpage preview appears to users with each type of colour blindness.

Common problems this reveals: red error messages that look similar to green success messages in Protanopia/Deuteranopia, blue links that are hard to distinguish from black text in some forms of colour blindness.

Step 6 — Fix Failing Combinations

Option 1 — Auto-fix Click the Auto-fix button in the contrast checker. The tool generates the nearest passing colour to your current text colour — adjusting luminance while preserving hue and saturation to keep your brand colour recognisable.

Option 2 — Manual adjustment Darken your text colour or lighten your background until the ratio reaches 4.5:1. As a reference: on a white (#FFFFFF) background, the darkest grey that fails AA is #787878 (4.48:1) — darker than #767676 (4.54:1 — passes AA).

Option 3 — Change font size If you cannot adjust your colours, increasing text to 18pt+ (or making it bold at 14pt+) drops the required ratio from 4.5:1 to 3:1 — which many mid-tone colours already meet.

Quick Reference — Colour Contrast Accessibility Checklist

  1. ✓ Body text on page background passes 4.5:1
  2. ✓ All headings pass appropriate threshold (4.5:1 or 3:1 if large)
  3. ✓ Navigation links pass against header background
  4. ✓ Button text passes against button background
  5. ✓ Form labels and placeholder text pass
  6. ✓ Error and success messages pass
  7. ✓ Footer text passes against footer background
  8. ✓ No reliance on colour alone to convey information
  9. ✓ Colourblind simulation checked for critical UI elements

Related tools:

  1. Free colour contrast checker — WCAG AA & AAA
  2. Accessibility contrast checker
  3. Contrast colour checker
  4. Color contrast analyzer free
× Enlarged image preview

Usage Limit Reached

You've used your 3 free tool uses. Please create a free account to continue using our tools without limits.