Glossary · Code

Contrast ratio

Definition: A contrast ratio measures the difference in lightness between two colours, usually text and its background. The scale runs from 1:1 (the same colour) to 21:1 (black on white). Under WCAG 1.4.3, body text needs at least 4.5:1 and large text 3:1 [1].

German: Kontrastverhältnis · Also: colour contrast · Last reviewed: 27 September 2026

Check your own colours with the contrast checker.

How the number is calculated

WCAG computes each colour's relative luminance, a value between 0 (black) and 1 (white). The ratio is (lighter + 0.05) divided by (darker + 0.05) [2]. Hue plays no part, only lightness. That is why a vivid red on green can look colourful and still have almost no contrast.

The values that apply

The values that apply
ContentLevel AALevel AAA
Body text4.5:17:1
Large text (18 pt, or 14 pt bold – roughly 24 px or 18.66 px)3:14.5:1
UI components and graphics3:1 (1.4.11)–

Logos, pure decoration and text in inactive controls are exempt [1].

Examples

  • Black on white: 21:1 – the highest possible value.
  • Grey #595959 on white: about 7:1 – enough even for Level AAA.
  • Grey #767676 on white: about 4.5:1 – just enough for body text.
  • Grey #777777 on white: 4.48:1 – just short, although it looks almost the same.

Nobody can see the difference between the last two by eye. That is why you measure rather than guess – once per colour pair in the design system, not again on every page.

Common mistakes

  • Light grey text on white for hints, placeholders or footers.
  • Text on photos with nothing behind it to darken the image.
  • Checking the default state only: hover, focus and error messages often have colours of their own.
  • Rounding luck: 4.48:1 is not 4.5:1 – the value is not rounded up.

How Reviseberg handles it

Reviseberg measures contrast with the axe-core rule color-contrast on every page, at 1280 px and again at 360 px wide, because mobile stylesheets can change colours. When text sits on an image or gradient, the measurement cannot decide; those spots go to a separate list of potential issues and never count as a pass.

Non-text contrast · Focus indicator · Screen magnifier · Automated accessibility testing

Further reading

Frequently asked questions

What contrast ratio does text need?

At least 4.5:1 for body text and 3:1 for large text, both at Level AA – the level EN 301 549 adopts for web content and the usual legal target.

Does placeholder text have to meet the contrast ratio?

Yes. Placeholder text is text and needs 4.5:1. It also does not replace a visible label.

Is it enough for links to differ by colour?

Not on its own. Under WCAG 1.4.1, colour must not be the only way to tell things apart. An underline is the simplest answer.

Sources

  1. W3C, WCAG 2.2, Success Criterion 1.4.3 Contrast (Minimum) – https://www.w3.org/TR/WCAG22/#contrast-minimum
  2. W3C, WCAG 2.2, definitions of "contrast ratio" and "relative luminance" – https://www.w3.org/TR/WCAG22/#dfn-contrast-ratio
  3. W3C, Understanding SC 1.4.3 – https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum
  4. WebAIM, Contrast Checker – https://webaim.org/resources/contrastchecker/

See what a scan finds on your site

One page in about thirty seconds, no email needed. The full report covers up to 100 pages and a keyboard journey.