Skip to content
Bulk orders? WhatsApp us
Toolsshark

Guides

WCAG contrast, explained with numbers you can use

What 4.5:1 actually measures, when 3:1 is enough, and how to fix a failing colour pair without changing your palette's character.

Published
5 Sept 2026
Reading time
1 min
By
Toolsshark Lab

WCAG contrast requirements are often treated as a checkbox, but the underlying idea is simple: text must differ enough in luminance from its background to be read by people with reduced vision or on poor screens.

What the ratio measures

The contrast ratio compares the relative luminance of two colours: (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter colour. It ranges from 1:1 (identical) to 21:1 (black on white). Hue does not count — only luminance.

The thresholds

ContentAAAAA
Body text4.5:17:1
Large text (24px, or 18.66px bold)3:14.5:1
UI components and graphics3:1—

Dark interfaces need the same care

Muted grey text on near-black is the most common failure in dark designs. A grey that looks comfortable on a calibrated monitor can fall below 4.5:1. Check secondary text, placeholders and disabled-looking labels that are still meant to be read.

Fixing a failing pair

  1. Adjust lightness, not hue. In HSL, move the text colour's lightness away from the background until the ratio passes.
  2. Change the size instead, where appropriate. A heading at 24px only needs 3:1.
  3. Avoid using opacity for text colour; it makes the result depend on the background beneath it.

Keep reading

All articles