Practical example
Test normal body text, placeholder text, and the hover state separately because each often uses a different foreground color.
Large heading text (24px)
Normal body text at 14-16px. Most interface copy, labels, and paragraphs fall into this category, so it has the strictest contrast requirements.
Contrast ratio measures how distinguishable text is from its background, on a scale from 1:1 (identical) to 21:1 (black on white). WCAG requires at least 4.5:1 for normal text and 3:1 for large text at level AA, and 7:1 / 4.5:1 at level AAA.
This checker computes the ratio from relative luminance exactly as defined by WCAG 2.x, shows pass/fail results for each level, and previews your colors on real text. HEX, RGB, and HSL notations are accepted.
A passing ratio is the baseline, not the finish line. Review how the pair behaves in real UI states and conditions.
A pair that passes on a light background can fail after dark-mode inversion. Check every theme you ship.
Hover, focus, disabled, and visited states often use lighter shades that silently fall below 4.5:1.
Pair color with icons, underlines, or text labels so information survives color-vision deficiencies.
The relaxed 3:1 threshold only applies from 24px, or 18.66px bold. Confirm the rendered size, not the design token.
Test normal body text, placeholder text, and the hover state separately because each often uses a different foreground color.
A translucent foreground has different effective contrast over every background underneath it, so the hex value alone is insufficient.
I use the numeric ratio as a gate, then verify focus, disabled, dark-mode, and high-contrast states in the actual component.
You may also find these tools useful.