contrast calculator

WCAG Color Contrast Calculator

Tip: WCAG treats text as "large" at 24px regular, or 18.66px bold and above.

Live preview

The quick brown fox jumps over the lazy dog. 1234567890

Why a contrast calculator matters

If users cannot clearly read your text, everything else on your page becomes less useful. Strong color contrast is one of the easiest accessibility improvements you can make, and it benefits everyone: users on mobile devices in sunlight, people with low vision, aging users, and anyone dealing with eye strain after a long day.

A contrast calculator helps you test whether a foreground and background color pair meets WCAG (Web Content Accessibility Guidelines) thresholds. Those thresholds are based on readability research and are widely used across design systems, product teams, and compliance audits.

How contrast ratio works

Contrast is measured as a ratio between two colors, from 1:1 (no contrast, same color) up to 21:1 (maximum contrast, such as black on white). The higher the number, the easier text is generally to read.

WCAG targets at a glance

  • AA Normal Text: at least 4.5:1
  • AA Large Text: at least 3:1
  • AAA Normal Text: at least 7:1
  • AAA Large Text: at least 4.5:1

"Large text" means around 24px regular or 18.66px bold. That is why this calculator lets you enter font size and weight in addition to color values.

How to use this tool effectively

1) Start with your brand palette

Enter your primary text and background colors first. If the ratio fails, do not guess repeatedly. Instead, adjust one color at a time while keeping the other fixed. This keeps brand consistency under control.

2) Test all states, not just default

Designers often validate body text but forget links, buttons, hover states, disabled states, and form placeholders. Contrast failures frequently hide in these edge cases.

3) Validate real component usage

A color pair that passes on paper can still fail in the product if text appears on gradients, images, translucent overlays, or tinted cards. Always test in realistic UI contexts.

Common contrast mistakes

  • Using light gray text on white backgrounds for "modern" aesthetics.
  • Relying on color alone to convey status, like red/green without labels or icons.
  • Lowering contrast for placeholder text so much that form fields become hard to understand.
  • Forgetting dark mode combinations and only validating light theme colors.
  • Ignoring chart labels, legends, and tooltip text in data visualizations.

Practical workflow for teams

Teams move faster when contrast checks happen early. A simple process:

  • Create semantic color tokens (for example: text-primary, surface-muted, link-default).
  • Pre-approve accessible pairings in your design system.
  • Use linting or visual regression checks to catch violations before release.
  • Manually spot-check key user journeys with accessibility tools and keyboard navigation.

This approach reduces rework and prevents accessibility from becoming a late-stage emergency.

Final thought

Better contrast is not just about compliance checklists. It is about clarity, trust, and usability. Users should never have to fight your interface to read basic information. Use the calculator above as a fast daily check while designing interfaces, writing content, and polishing UI components.

🔗 Related Calculators