Skip to content

Menu

Contrast Ratio Checker

Check WCAG color contrast ratios between foreground and background colors.

Runs entirely in your browserAccessibilityFree, no sign-up
Loading tool

01What is Contrast Ratio Checker?

This checker measures the contrast between a text colour and a background colour using the formula in WCAG 2.2 (unchanged from 2.1) and tells you which success criteria the pair meets. Enter each colour as a hex code, either six digits like #1f2937 or the three-digit short form like #fff, or pick it with the colour swatch. Each colour is converted to relative luminance: the sRGB channels are linearised with the 0.04045 threshold given in WCAG 2.2, then weighted 0.2126 for red, 0.7152 for green and 0.0722 for blue. The ratio is (lighter + 0.05) / (darker + 0.05), which runs from 1:1 for identical colours to 21:1 for black on white. Four results follow: AA for normal text (4.5:1), AA for large text (3:1), AAA for normal text (7:1) and AAA for large text (4.5:1). WCAG doesn't round, so a pair at 4.497:1 fails AA, and the ratio shown is cut off rather than rounded, which means it reads 4.49:1, not a misleading 4.50:1 next to a fail. (The earlier version rounded, so #0081a3 on white displayed 4.50:1 while failing.) A preview panel shows large, normal and small sample text in your colours so you can judge readability by eye as well. If a hex code is incomplete or invalid, the tool says so instead of showing stale results. It handles opaque colours only; for colours with an alpha channel use the Accessibility Contrast Checker on this site, which composites transparency before measuring. This tool doesn't suggest replacement colours, so if a pair fails, adjust the lightness yourself and watch the ratio update. A quick worked case: #777777 on white gives a raw ratio of about 4.478, so the tool shows 4.47:1 and fails AA for normal text, while #767676 reaches 4.54:1 and passes. One shade of grey decides it. Both colours are read and measured inside the page itself, so your palette is not uploaded or logged anywhere. For text placed on a photo or gradient, measure against the lightest and the darkest area behind it, since the tool compares only two flat colours.

Frontend developers validating accessible designs, UX designers checking color choices, and accessibility auditors reporting WCAG compliance findings. The tool runs entirely in your browser, so your data never leaves your device.

02How to use Contrast Ratio Checker

  1. Enter the Foreground Color as a hex code or pick it with the swatch.
  2. Enter the Background Color the same way.
  3. Read the Contrast Ratio and the four AA and AAA results.
  4. Check the Sample Text Preview to see the pair at different sizes.
  5. Click the copy icon to copy the ratio for your audit notes.

03Worked examples

Input: Foreground #777777 on background #ffffff
Result: 4.47:1 - AA normal text: fail, AA large text: pass
The exact ratio is 4.478, which the tool truncates rather than rounds, because WCAG thresholds are not rounded up.
Input: Foreground #767676 on background #ffffff
Result: 4.54:1 - AA normal text: pass, AAA normal text: fail
One step darker than #777777 is enough to cross the 4.5:1 AA threshold for normal text.
Input: Foreground #000 on background #fff
Result: 21.00:1 - passes all AA and AAA checks
21:1 is the maximum possible ratio; 3-digit hex is accepted.
Input: Foreground #3B82F6 on background #ffffff
Result: 3.67:1 - AA normal text: fail, AA large text: pass
A common mid blue on white is fine for large text (3:1) but not for body text.
Input: Foreground #ffffff on background #1E293B
Result: 14.62:1 - passes all AA and AAA checks
Input: Foreground #0081a3 on background #ffffff
Result: 4.49:1 - AA normal text: fail, AA large text: pass
The raw ratio is 4.4977. Rounding would show 4.50:1 next to a fail, so the tool truncates instead.

04Common use cases

  • Checking that body text and link colours meet WCAG AA before a release
  • Confirming a brand colour is only used for large headings if it reaches 3:1 but not 4.5:1
  • Checking icon and input-border colours against the 3:1 non-text contrast requirement
  • Settling a design review debate with a number instead of an opinion
  • Checking disabled-button and placeholder greys, which designers often push too light, before a ticket is closed

05Tips

  • Large text is at least 18pt (24px) regular or 14pt (about 18.66px) bold; only then does the 3:1 AA threshold apply to text.
  • #767676 is the lightest grey that passes 4.5:1 on white (4.54:1); #777777 just fails at 4.47:1.
  • Contrast says nothing about hue, so also check that meaning isn't carried by colour alone (WCAG 1.4.1).
  • Text over images or gradients needs checking against the lightest and darkest part behind it, not an average.

06Related concepts

WCAG 2.2, Relative luminance, Colour accessibility, AA/AAA compliance, Non-text contrast.

Frequently Asked Questions

What is Contrast Ratio Checker?

Contrast Ratio Checker is a free, browser-based developer tool on AIDToolStack. Check WCAG color contrast ratios between foreground and background colors. It requires no installation or sign-up and works entirely in your browser.

Is Contrast Ratio Checker free to use?

Yes. No sign-up, no fees and no usage cap.

Does Contrast Ratio Checker store my data?

No. It runs in your browser; nothing is uploaded.

Cheat sheet

Related Tools

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe