What the contrast ratio actually measures
WCAG contrast is not a measure of how different two colors look — it is a ratio of their relative luminance, the brightness a standard observer perceives. Green contributes far more to that figure than blue does, which is why a mid blue on black can fail while a mid green on black passes, even though both look equally "colored" to a designer.
The ratio runs from 1:1 (the same color) to 21:1 (black on white). The formula divides the lighter color's luminance plus 0.05 by the darker color's luminance plus 0.05, and this tool implements it exactly as the specification states rather than approximating.
The thresholds, and why there are three
- 4.5:1 — normal text (AA). The baseline for body copy. This is the number most audits are failed on.
- 3:1 — large text (AA). Text at 24px, or 18.66px if bold, counts as large. Bigger glyphs have thicker strokes, so they survive lower contrast.
- 7:1 — normal text (AAA). Required for the enhanced conformance level, and genuinely useful for text that people read for a long time.
- 3:1 — user interface components (1.4.11). Icons, input borders, focus indicators and chart keys must meet this against what surrounds them. This is the criterion most teams forget: the text passes, and the input outline it sits in does not.
Fixing a failure without abandoning your palette
When a color fails, the usual instinct is to reach for a different one. Usually you do not need to: the tool walks your color towards black or white — whichever direction the background calls for — and returns the nearest shade that clears 4.5:1. The hue is preserved, so the result still belongs to your brand palette.
The preview above the numbers matters as much as the numbers. Contrast that technically passes can still be uncomfortable at small sizes on a dim screen, and text that clearly reads on your monitor may be unusable on a phone in sunlight.