Contrast Checker

The quick brown fox jumps over the lazy dog — normal text.

Large heading text, 24px bold.

In short: black on white is 21:1, the maximum. Grey #777777 on white is 4.48:1 — a hair under the 4.5:1 that WCAG AA demands for body text, which is why that fashionable light grey fails. Pick or type two colours and this page gives the ratio, the AA and AAA verdicts for normal and large text, and a live preview in your actual colours.

How the ratio is calculated

WCAG contrast is not the difference between two hex codes; it is the ratio of their relative luminances — how bright each colour is as human vision weights it. Each sRGB channel is first linearised (the gamma curve is undone with the standard formula: divide by 12.92 if the channel is at most 0.03928, otherwise raise (c + 0.055) / 1.055 to the power 2.4), then combined as L = 0.2126 R + 0.7152 G + 0.0722 B. Green dominates the weighting because eyes are most sensitive to it — which is why a pure green looks brighter than a pure blue at the same numeric intensity. The ratio is then (lighter + 0.05) / (darker + 0.05), running from 1:1 for identical colours to 21:1 for black on white. This page computes exactly that, in your browser, and the worked values were checked against the reference examples: #777777 on white is 4.48, #767676 is 4.54 — one step of grey across the AA line.

The thresholds: WCAG AA, the level most laws and procurement rules point at, requires 4.5:1 for normal text and 3:1 for large text (at least 24px, or 19px bold). AAA, the enhanced level, requires 7:1 and 4.5:1. Logos, decorative text and disabled controls are exempt; text over photographs and gradients is judged at its weakest point, which is usually much weaker than designers assume.

Fixing a failing pair

When a pair fails, the smallest fix is usually a shade, not a redesign: darkening the text grey by one step (#777777 to #767676) crosses the AA line on white while looking, to most eyes, identical. On coloured backgrounds, adjust whichever colour is not brand-fixed. If both colours are fixed, add a third element — a solid panel behind the text, a darker overlay on the photo, or a heavier font weight with a larger size to qualify as large text (though reaching for "large text" to excuse weak contrast is a loophole to use sparingly: headings forgive, body text does not). Also check the pair in the states users actually meet: link hover colours, placeholder text (a notorious failure — it is still text), and text over the lightest part of any image.

And a boundary of the standard worth knowing: WCAG contrast says nothing about hue. Red on green can pass the ratio while remaining unreadable to a colour-blind reader, and about 1 in 12 men have some colour-vision deficiency. Use this checker for the luminance question it answers, and do not ask colour alone to carry meaning — underline the link, label the error, mark the required field — so the information survives every kind of vision.

A worked example

A design uses #777777 body text on a white background. Luminance of #777777: each channel is 0x77 = 119, normalised 0.467, linearised to 0.184, so L = 0.184. White has L = 1. Ratio: (1 + 0.05) / (0.184 + 0.05) = 4.48:1. Verdict: fails AA for normal text by 0.02, passes AA for large text, fails AAA. One step darker, #767676: luminance 0.181, ratio 4.54:1 — AA passes for all text, AAA still fails (it needs 7:1, reached around #595959 on white). The whole drama of accessible grey lives in those two hex steps, and it is why "the grey looks fine" is not a test and this page is.

Frequently asked questions

What contrast ratio do I need for WCAG AA?

4.5:1 for normal text, 3:1 for large text. Large means at least 24px, or at least 19px if bold (WCAG phrases it as 18pt, or 14pt bold). AA is the level referenced by most accessibility laws and standards — the European EN 301 549, US Section 508 and most public-sector rules. AAA raises the bar to 7:1 for normal text and 4.5:1 for large text, and is required only in specific contexts, not across whole sites.

Why does light grey text fail so often?

Because the maths is unforgiving in the light range. On white, a grey must reach #767676 or darker to pass AA for body text — and most "elegant" greys chosen by eye (#999999, #AAAAAA) sit at 2.8:1 and 2.3:1, half the required contrast. The eye judging a design on a bright calibrated monitor in a dark studio overestimates readability for a user on a phone in sunlight. The ratio is the same everywhere; eyes and conditions are not.

Does the ratio change if I swap text and background?

No. The formula divides the lighter luminance by the darker, so the pair gives the same ratio either way round — white text on #767676 is also 4.54:1. What changes is readability in practice: light text on dark backgrounds can shimmer for readers with astigmatism (halation), so dark mode designs often need slightly more contrast headroom than the ratio alone suggests. The checker has a swap button so you can preview both arrangements in your colours.

What about text over images and gradients?

Judge it at the weakest point the text touches: the lightest part of the photo behind any letter. In practice that means either measuring against the worst-case area, or engineering the problem away — a solid or semi-opaque panel behind the text, a darkened overlay on the image, or moving the text off the image entirely. A ratio measured against the image's average brightness is a fiction; users read against the actual pixels under the glyphs.

Is passing contrast enough for accessibility?

It is one requirement among many. Contrast does not cover colour-blind safety (never encode meaning in hue alone), focus visibility, target size, or text resizing. Think of the ratio as a floor: below it, a large share of readers with low vision, ageing eyes or poor screens simply cannot read your text at all. Above it, the other work still matters. But it is the floor most designs fail, which is why it has its own checker.

Related tools

Formula and thresholds checked on 24 November 2026 (WCAG 2.1, sections 1.4.3 and 1.4.6). Everything runs in your browser — nothing you type is sent anywhere.