🔒 100% private — runs in your browser, nothing is uploaded

Contrast Checker

WCAG contrast ratio for a text and background colour pair — AA and AAA pass/fail badges for normal and large text, with a live sample.

Contrast ratio is the WCAG yardstick for whether text can be read against its background. It is computed from relative luminance — how bright each colour is after the sRGB values are linearised with the WCAG 2.x formula — as (lighter + 0.05) ÷ (darker + 0.05), giving a scale from 1:1 (same colour, invisible text) to 21:1 (black on white). The passing lines are 4.5:1 for normal text at AA, 3:1 for large text at AA, 7:1 for normal text at AAA and 4.5:1 for large text at AAA. The worked example shows how fine the line is: the classic grey #777777 on white scores 4.48:1 — it fails AA for normal text by two hundredths, while passing AA for large text; darken the grey by a single hex step to #767676 and the ratio becomes 4.54:1, which passes AA outright. That is why “the grey looked fine” is not a check — the difference between passing and failing body text is routinely one invisible step.

Contrast ratio
21:1
AA · normal text AA · large text AAA · normal text AAA · large text

Normal text at 16px — the quick brown fox jumps over the lazy dog. This is the size most body copy is read at, so it needs the full AA ratio of 4.5:1.

Large text at 24px bold — headings like this count as “large” and need 3:1 at AA.

Everything runs in your browser; your values are never uploaded, stored or put into a link. Ratios follow the WCAG 2.x relative-luminance formula; “large text” means at least 24px, or 18.66px if bold.

Quick answers

What is a good contrast ratio for body text?

At least 4.5:1 to meet WCAG AA for normal text; aim for 7:1 (the AAA line) when the text is small, thin or read for long stretches. Black on white is the maximum at 21:1.

Check your lightest grey text, not your body colour — captions, footnotes and placeholder text are where real sites fail. Placeholders count as text.

Why does one hex step change a pass into a fail?

Because the AA line (4.5:1) cuts through the middle of the popular mid-greys: #777777 on white is 4.48:1 (fail), #767676 is 4.54:1 (pass). Luminance is computed per channel, so a single step in all three channels moves the ratio by a few hundredths — right where the threshold sits.

Never eyeball greys near the line; run the pair through the checker and keep a small margin above 4.5 for anti-aliasing and screen variation.

How to use

  1. Pick or type the text (foreground) colour — use the colour well or enter a hex value such as #767676.
  2. Pick or type the background colour the text will sit on.
  3. Read the ratio and the four badges: AA and AAA, each for normal text and for large text (24px, or 18.66px bold).
  4. Use Swap to test the reversed pair — the ratio is identical, but the badges help you check both directions of a design (for example a button and its hover state).

About this tool

This checker has one job — scoring a single foreground/background pair — and two neighbours on this site cover the adjacent jobs. The Colour Blindness Simulator (color-blindness-simulator) shows how a whole palette actually looks to users with colour-vision deficiencies, which a ratio cannot tell you: two colours can pass contrast yet become indistinguishable hues for a colour-blind reader. The Colour Converter (color-converter) converts a colour between hex, RGB and HSL when a design tool hands you a value in the wrong format for this checker. Two honest limits of the ratio itself: it knows nothing about font weight or rendering beyond the normal/large split, so thin fonts deserve extra headroom above the minimum; and text over gradients or photos has no single background — test the worst-case (lightest or darkest) part of the backdrop the text actually crosses.

Frequently asked questions

What contrast ratio do I need for WCAG AA?

4.5:1 for normal text and 3:1 for large text. Large means at least 24px, or at least 18.66px (14pt) when bold. AAA, the stricter level, asks 7:1 for normal text and 4.5:1 for large text. This checker shows all four verdicts side by side for your pair.

Is #777777 grey on white accessible?

Almost, but not quite: #777777 on #ffffff is 4.48:1, which fails AA for normal text (it needs 4.5:1) while passing AA for large text. The standard fix is one step darker — #767676 on white is 4.54:1 and passes AA for all text sizes.

Does the order of the two colours matter?

No. The formula always puts the lighter luminance over the darker, so white text on a #767676 background scores the same 4.54:1 as #767676 text on white. The Swap button exists because designs still need both directions checked in context — buttons, hover states and selected rows often invert the pair.

What about icons, borders and other non-text elements?

WCAG 2.1 also sets 3:1 for essential non-text elements — icon glyphs, input borders, chart lines, focus indicators — against adjacent colours (success criterion 1.4.11). The same ratio from this checker applies; just read the AA large-text line (3:1) as the non-text threshold, and remember purely decorative elements are exempt.

📦 Embed this tool on your site

<iframe src="https://verystep.com/embed/contrast-checker/" title="Contrast Checker" width="100%" height="520" loading="lazy" style="border:0"></iframe>

Free to use. The embed shows a small "Powered by Verystep" link.

First time embedding? Read the step-by-step guide →

More free tools