Skip to content

Color Contrast Checker

Check text contrast against WCAG AA and AAA accessibility levels.

Updated · Examples checked by automated tests

LOCAL WORKSPACENO UPLOAD REQUIRED

Large text sample

Normal body text at 16 pixels — the size most of your content will actually use.

Small print at 14 pixels.

7.73:1

Contrast ratio

AA — normal text

Needs 4.5:1

Pass

AA — large text (18.66px bold / 24px)

Needs 3:1

Pass

AAA — normal text

Needs 7:1

Pass

AAA — large text

Needs 4.5:1

Pass

Non-text elements (icons, borders)

Needs 3:1

Pass

About Color Contrast Checker

Contrast ratio is the most testable accessibility requirement there is, and low-contrast text is one of the most common failures found in audits.

This checker computes the WCAG relative luminance ratio between your foreground and background, shows pass or fail for each conformance level and text size, and previews real text at both sizes.

How Color Contrast Checker works in your browser

The contrast ratio is computed exactly as WCAG 2.1 defines it. Each colour’s sRGB channels are linearised by reversing the gamma curve, combined into relative luminance with the coefficients 0.2126 R, 0.7152 G and 0.0722 B — weighted for the eye’s differing sensitivity to each — and the two luminances are compared as (lighter + 0.05) / (darker + 0.05).

The result runs from 1:1 for identical colours to 21:1 for black on white. AA requires 4.5:1 for body text and 3:1 for large text, which WCAG defines as 18pt, or 14pt bold. AAA requires 7:1 and 4.5:1 respectively.

Try black (#000000) on white (#ffffff): 21:1. Grey #777777 on white is about 4.48:1 and fails normal-text AA; do not round it up to a pass. Check the actual composited background when opacity, gradients or images are involved. A passing ratio is a floor, not a guarantee. The formula does not model colour blindness, screen glare, or the way very thin fonts read lighter than their colour value suggests. Text that passes at exactly 4.5:1 in a hairline weight is still hard to read.

When to use it

  • Checking a colour pair against WCAG AA before it ships into a design system.
  • Finding the minimum lightness adjustment that brings existing brand colours into compliance.
  • Verifying that a dark-mode palette passes as well as its light counterpart.
  • Documenting accessibility conformance for an audit or a procurement requirement.

Worked examples

A grey that looks fine but fails

Settings: Text #777777, background #ffffff

Input

#777777 on #ffffff

Expected output

Contrast ratio: 4.48:1
AA — normal text: Fail
AA — large text (18.66px bold / 24px): Pass
AAA — normal text: Fail
AAA — large text: Fail
Non-text elements (icons, borders): Pass

At 4.48:1 the pair is just under the 4.5:1 needed for normal body text. It passes for large text and for icons and borders, which need 3:1.

Dark text on an off-white background

Settings: Text #1f2937, background #f9fafb

Input

#1f2937 on #f9fafb

Expected output

Contrast ratio: 14.05:1
AA — normal text: Pass
AA — large text (18.66px bold / 24px): Pass
AAA — normal text: Pass
AAA — large text: Pass
Non-text elements (icons, borders): Pass

This pair clears even the AAA threshold of 7:1, so it suits long passages of small text.

Limits and checks before you use the result

  • Colours are treated as opaque. Enter the blended colour you actually see when using transparency or text over images.
  • The WCAG 2.1 ratio does not model colour vision deficiency or font weight; thin fonts need more contrast than the ratio suggests.
  • Results are not rounded up: 4.48:1 fails a 4.5:1 requirement.

Frequently asked questions

What ratio do I need?

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

What counts as large text?

At least 18.66 pixels bold, or 24 pixels regular.

Does contrast apply to icons and borders?

Yes. Meaningful non-text elements such as icons and input borders need at least 3:1 under WCAG 2.1.

Related tools