Color Contrast Checker

By Priya Nair, Editor

WCAG 2.1 AA & AAA accessibility compliance for any color combination

Preview Text Here
Contrast Ratio
WCAG AA Normal WCAG AA Large WCAG AAA Normal WCAG AAA Large
Based on WCAG 2.1 relative luminance formula

WCAG Contrast Requirements

LevelNormal TextLarge Text
AA4.5:13:1
AAA7:14.5:1

Large text = 18pt+ (24px) or 14pt+ (18.5px) bold

Why Color Contrast Matters

The Web Content Accessibility Guidelines (WCAG) require minimum contrast ratios between text and its background. Poor contrast makes content unreadable for users with visual impairments, color blindness, or low vision. Compliance isn't just ethical — it's required by law in many jurisdictions (Section 508, ADA, EN 301 549).

Contrast Ratios and What the Thresholds Mean

Contrast is the difference in perceived brightness between text and the surface behind it. Get it wrong and your interface is unreadable for people with low vision, for anyone using a phone in sunlight, and increasingly for everyone as displays and eyes vary. The Web Content Accessibility Guidelines turn that into a measurable number, and this checker calculates it for any pair of colors.

How the ratio is calculated

Every color has a relative luminance, a value from 0 for black to 1 for white, derived from its red, green, and blue channels after each has been linearised and weighted for how sensitive human vision is to it. Green contributes most, blue least. The contrast ratio between two colors is then the lighter luminance plus 0.05, divided by the darker luminance plus 0.05.

That formula produces a value between 1 and 21. Identical colors give 1 to 1, meaning no contrast at all. Pure black on pure white gives 21 to 1, the theoretical maximum. The small 0.05 offset accounts for ambient light reflecting off a real screen, which is why even black on white does not reach infinity.

The thresholds you need to hit

Worked example

A common mistake is mid-grey text on white. Grey at #777777 on a white background gives roughly 4.48 to 1, which fails AA for body text by a hair, even though it looks fine to most designers on a good monitor. Darkening it slightly to #767676 pushes it just past 4.5 and it passes. That is how tight the margin often is, and exactly why you check the number instead of trusting your eye.

How to use it

  1. Enter your foreground and background colors as hex values.
  2. Read the ratio and the pass or fail result for each level.
  3. If it fails, adjust lightness rather than hue. Changing how light or dark a color is moves the ratio far more than shifting its hue does.
  4. Re-check any state you forgot: hover, disabled, placeholder text, and text sitting on top of an image.

Tips

Frequently asked questions

Which WCAG version does this use? The contrast ratio definition and thresholds from WCAG 2.1, which are unchanged from 2.0 and carried into 2.2.

Does it handle transparency? Enter the color that actually results after the layer is composited over its background, since the ratio depends on the final rendered color.

Is AA good enough? AA is the usual legal and contractual benchmark. AAA is better where long-form reading is the point.

Related Reading

How contrast ratios are measured

Colour contrast is expressed as a ratio between the relative luminance of the text and its background, running from 1 to 1 for identical colours up to 21 to 1 for pure black on pure white. The Web Content Accessibility Guidelines set the thresholds that make text readable for people with low vision, and the checker above compares your two colours against them.

The WCAG thresholds

For level AA, normal text needs a contrast ratio of at least 4.5 to 1, and large text needs at least 3 to 1. Large text is defined as roughly 18pt, which is about 24px, or 14pt, about 18.66px, when bold. The stricter level AAA raises those to 7 to 1 and 4.5 to 1. Meeting AA is the common target for most public websites.

Using the result well

Passing the ratio is necessary but not sufficient, because colour alone should never be the only way you convey meaning; pair it with text, underlines, or icons for anyone who cannot distinguish the colours. If a brand colour fails, you can often keep it by darkening the text slightly or adding a subtle background rather than abandoning the palette.

Source: W3C WAI: Understanding Contrast (Minimum)

AboutContactPrivacy Policy