Accessibility

Free Contrast Checker

Test any foreground and background colour against WCAG 2.1 standards. Get the exact contrast ratio, AA/AAA pass-fail badges and one-click accessible alternative suggestions.

Live ratios 100% offline WCAG 2.1 AA & AAA Auto-fix suggestions

Text colour

FOREGROUND
#
Swap

Background

BACKGROUND
#
Contrast ratio
7.48:1
Passes AA normal text
AA Normal text โ€”
Requires โ‰ฅ 4.5:1
AAA Large text โ€”
Requires โ‰ฅ 4.5:1
AA Large text โ€”
Requires โ‰ฅ 3:1
AAA Normal text โ€”
Requires โ‰ฅ 7:1
UI components & graphics โ€”
Requires โ‰ฅ 3:1 (buttons, icons, input borders, chart lines)

Suggested accessible alternatives

Closest shades that pass โ€” same hue, adjusted lightness.

Live preview

Heading
The quick brown fox jumps over the lazy dog.
Body text
Good contrast keeps text readable for everyone โ€” including people with low vision, colour blindness or anyone using their phone in bright sunlight. WCAG 2.1 sets specific minimum ratios to make this objective rather than subjective.
Small print
Small text is hardest to read โ€” it needs the most contrast. This is typical caption or footnote size at 12px.
Interactive elements
Inline link Badge

About WCAG Contrast

Contrast ratio measures the difference in perceived brightness between two colours, on a scale from 1:1 (no contrast โ€” grey on grey) to 21:1 (maximum โ€” black on white). The Web Content Accessibility Guidelines (WCAG), published by the W3C, define minimum ratios so that text stays readable regardless of vision, display quality or lighting conditions.

Contrast is the single most commonly failed accessibility check on the web. It affects roughly 1 in 12 men and 1 in 200 women with some form of colour blindness, everyone over 40 as the lens of the eye yellows, and anybody using a phone outdoors. Good contrast is not just a legal checkbox โ€” it is the difference between a design that works and one that doesn't.

WCAG 2.1 contrast requirements

LevelText sizeMinimum ratio
AANormal (under 18pt / 24px)4.5:1
AALarge (18pt+ / 24px+, or 14pt+ bold)3:1
AAANormal7:1
AAALarge4.5:1
AA (non-text)UI components, icons, form borders3:1

AA is the standard required by law in many jurisdictions (WCAG 2.1 AA is the current legal baseline for public-sector sites in the EU and US federal agencies). AAA is a stricter, aspirational target โ€” aim for it on essential content if you can, but don't let it block your whole design.

What counts as "large text"

WCAG defines large text by points, which map to CSS pixels at the usual 96 dpi:

In practice, most headings and hero copy qualify as large text and get the lower 3:1 / 4.5:1 thresholds. Body text, labels, captions and small print almost never qualify โ€” they need the full 4.5:1 AA or 7:1 AAA.

How the ratio is calculated

WCAG uses relative luminance, which is not the same as average RGB brightness. The formula weights the three channels according to how the human eye actually perceives them โ€” green contributes about 71% of perceived brightness, red about 21% and blue only about 7%. Then:

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

where L1 is the lighter colour's luminance and L2 is the darker. The + 0.05 prevents division by zero for pure black. The result is always between 1:1 and 21:1, regardless of which colour is on top.

Beyond text: UI components and graphics

WCAG 2.1 added Success Criterion 1.4.11 (Non-text Contrast), which requires 3:1 for:

This is why a subtle grey input border that "looks nice" may fail WCAG โ€” it needs to be visible against both the page background and any fill inside the input.

Tips for hitting contrast targets

Common use cases

Accessibility audits

Verify every text/background pair in your UI.

Building design systems

Test tokens before shipping them across an app.

Legal compliance

Meet WCAG 2.1 AA for public-sector or enterprise work.

Mobile readability

Check colours hold up on cheap screens and bright light.

Branding

Choose brand colours that work as real UI, not just swatches.

Data viz

Ensure chart lines and labels stay distinguishable.

Privacy and accuracy

This contrast checker runs entirely in your browser. All calculations happen locally in JavaScript using the WCAG relative-luminance formula. The colours you enter are never transmitted, stored or logged.

Frequently Asked Questions

What is WCAG contrast ratio?
WCAG contrast ratio measures the difference in perceived brightness between two colours, on a scale from 1:1 (no contrast, e.g. grey on grey) to 21:1 (maximum, black on white). The Web Content Accessibility Guidelines define minimum ratios so text stays readable for people with low vision, colour blindness or on poor displays.
What ratio do I need for WCAG AA?
For WCAG 2.1 AA: normal text needs at least 4.5:1 contrast, large text (18pt+ or 14pt+ bold) needs at least 3:1, and non-text content like icons, borders and input outlines needs at least 3:1.
What ratio do I need for WCAG AAA?
For WCAG 2.1 AAA: normal text needs at least 7:1 contrast, and large text needs at least 4.5:1. AAA is the strictest level and is recommended for essential content and public-sector sites.
What counts as large text?
WCAG defines large text as 18pt (24px) or larger for regular weight, or 14pt (18.66px) or larger for bold text. Headings, hero copy and CTA buttons usually qualify as large text and have a lower contrast requirement.
How is the contrast ratio calculated?
First, each colour is converted to relative luminance using a formula that accounts for how the human eye perceives red, green and blue. The ratio is then (L1 + 0.05) / (L2 + 0.05) where L1 is the lighter luminance and L2 is the darker. The result is always between 1:1 and 21:1.
Why does contrast matter beyond legal compliance?
Low contrast is one of the most common accessibility failures on the web. It affects people with low vision, colour blindness and age-related vision changes, and it also hurts everyone on a phone in bright sunlight. Good contrast improves readability, reduces eye strain and widens your audience.
What does the suggestion feature do?
When your colour pair fails a target, the tool finds the closest shade of the foreground that passes โ€” keeping hue and saturation but adjusting lightness. One click replaces the current colour with the suggested accessible alternative.
Is this contrast checker free?
Yes, it is 100% free, requires no sign-up and runs entirely in your browser. No length limits, no watermarks, no premium tier.

Related Colour Tools

Done!