Skip to content

How the Detector measures text size for color contrast ​

What it does ​

Color contrast rules are stricter for small text than for large text. So before checking contrast, the Detector needs to know: is this text large or not?

To decide that, it reads the text size exactly as your browser displays it on screen, and then checks it against the accessibility guidelines. A few things worth knowing:

  • It uses the real, final size. Web pages can set text size in many different ways, but the browser always works out one final size in pixels. That final size is what the Detector reads — so how the size was originally written in the code never changes the result.
  • It looks at the most prominent text. If a section contains text of different sizes or weights, the Detector focuses on the boldest and biggest visible text, since that's what stands out to the reader.
  • It accounts for bold. Bold text is allowed to be a bit smaller and still count as "large," so the Detector checks the weight too.
  • Invisible text is skipped. Text that's hidden or has no size (for example, text kept only for screen readers) isn't checked, because there's nothing on screen to measure.

Points vs. pixels — what's the difference? ​

You'll see two units mentioned, and this often causes confusion:

  • Points (pt) come from the world of print. The accessibility guidelines were written using points — they define "large text" as 18 pt (or 14 pt when bold).
  • Pixels (px) are what screens and browsers actually use.

The two are just different names for the same thing, connected by a fixed conversion (1 pt = 1.333 px). So the guideline sizes translate cleanly to what you see on screen:

TextGuidelines sayOn screenContrast needed
Large18 pt~24 px3:1
Large & bold14 pt~18.67 px3:1
Normalsmaller than abovesmaller than above4.5:1

In plain terms: points are the unit written in the rulebook, pixels are what your browser uses. The Detector measures in pixels because that's what the page actually shows, and applies the matching rule. That's why a piece of text that looks fairly large can still be asked to meet the stricter contrast level — it comes down to the exact size, not how big it feels.

What counts as "bold" for the relaxed 14 pt rule is covered in Font weight.