WCAG Contrast Checker
Text that cannot be read is content that does not exist. The Web Content Accessibility Guidelines set a measurable floor for how different a text color must be from its background — this checker applies that exact formula to any pair and returns the ratio with the four standard verdicts.
This site holds its own design to the same standard: every text color pair in the CalcBean design system passes AA, and the pairs are audited against this formula — the checker below is the same math, pointed at your colors.
The quick brown fox jumps over the lazy dog
This preview is the actual pair: body text at normal size.
Contrast ratio
5.31 : 1
Text #0B7A5C · hsl(164, 83.5%, 26.1%) · Background #FFFFFF · hsl(0, 0%, 100%)
How it is worked out
- Relative luminance of the text color: 0.1476; of the background: 1.0000 (WCAG's linearized-sRGB formula).
- Ratio = (lighter + 0.05) ÷ (darker + 0.05) = (1.0000 + 0.05) ÷ (0.1476 + 0.05) = 5.31 : 1.
- Thresholds: AA needs 4.5:1 for normal text and 3:1 for large text; AAA needs 7:1 and 4.5:1. Verdicts are judged on the unrounded ratio (5.3130), not the printed 5.31.
Embed this calculator on your website →
The formula
ratio = (Llighter + 0.05) ÷ (Ldarker + 0.05)
L = 0.2126·R + 0.7152·G + 0.0722·B (each channel linearized first)
- relative luminance — how bright a color is as the eye sees it, after the WCAG linearization: channel ÷ 12.92 when the channel is at or below 0.03928 of full scale, otherwise ((channel + 0.055) ÷ 1.055)^2.4. Green dominates the weights because human vision is most sensitive to it.
- thresholds — AA: 4.5:1 for normal text, 3:1 for large text (at least 18pt, or 14pt bold). AAA: 7:1 and 4.5:1.
- judged unrounded — the printed ratio is rounded to 2 decimals, but verdicts use the exact value: a pair at 4.4997 prints "4.50" and still fails AA. The working under the result shows the unrounded figure it was judged on.
Worked example: this site's deep green #0B7A5C on white gives 5.31 : 1 — passes AA for normal text, falls short of AAA. It is the default pair in the tool above.
How it works
Why a ratio, not a distance. Two colors can be far apart as numbers and nearly identical to the eye — bright green and mid grey, for example — because vision responds to luminance far more than to hue. The WCAG formula therefore ignores hue almost entirely (only the channel weights carry it) and asks a single question: how much brighter is one surface than the other?
The famous boundary. On white, #777777 gives 4.48:1 and fails AA for body text, while #767676 — one step darker — gives 4.54:1 and passes. Whole design systems have shipped the wrong one of those two greys. It is the clearest demonstration of why verdicts here are judged on the unrounded ratio.
What this does not judge. Contrast is one requirement among many: font size, weight, line height, and spacing all affect readability, and WCAG has separate criteria for non-text elements (icons, focus indicators, chart parts need 3:1 against adjacent colors). This checker answers the text-contrast question exactly; it does not certify a page accessible.
Examples
- Black on white → 21.00 : 1 — the maximum possible ratio, passing every level.
- #17C08A on white → 2.35 : 1 — this site's bright accent green: lovely for a logo, failing every text level. It is used here only where text does not depend on it.
- #FF0000 on white → 4.00 : 1 — pure red passes AA only for large text, despite looking "strong".
- White on white → 1.00 : 1 — the floor: no contrast at all.
Frequently asked questions
Which level should I aim for, AA or AAA?
AA is the level laws and procurement standards around the world actually reference (and the level this site is built to). AAA is the stricter aspirational level — worth reaching for body text when the design allows, but not always achievable across a full palette, which is why WCAG itself does not recommend requiring AAA for entire sites.
What counts as large text?
At least 18 points (about 24 CSS pixels), or 14 points (about 18.5 pixels) and bold. Headlines and large buttons usually qualify; body copy, captions, and footnotes do not. When in doubt, judge the pair as normal text — the safer reading.
My colors pass but the text is still hard to read. Why?
Contrast is a floor, not a guarantee. Small sizes, thin font weights, text over photographs or gradients (where the background varies under every letter), and poor lighting all defeat a passing ratio. The checker assumes a flat background of exactly the color you entered — text over an image needs checking against the lightest patch behind it.
Why does the printed ratio say 4.50 but the verdict is Fail?
Because the verdict is honest in the way that matters: the unrounded ratio is 4.4997 (or similar), which is below the 4.5 threshold, while the printed figure is that value rounded to two decimals. Judging on the printed, rounded number would let pairs pass that the standard fails — so the working under the result shows the unrounded value the verdict came from.
Related calculators
Color Converter
LiveConvert colors between HEX, RGB, and HSL with a live swatch — the standard CSS color formulas, with the rounding rules stated.
JSON Formatter & Validator
LiveFormat, validate, and minify JSON, with the exact position of any syntax error pointed out.
Password Generator
LiveCreate strong random passwords with your browser's secure random generator — nothing is sent or stored.

