Skip to main content
CalcChef

Color Contrast Checker

Enter a text and a background color, with opacity, to get the WCAG contrast ratio and AA and AAA pass or fail for normal and large text. How it works

Use the Color Contrast Checker

Opacity100%
Opacity100%
Contrast Ratio
21.00:1
AA Normal Pass · AAA Normal Pass
AA Normal TextPass
21.00:1, 366% above 4.5:1
AA Large TextPass
21.00:1, 600% above 3:1
AAA Normal TextPass
21.00:1, 200% above 7:1
AAA Large TextPass
21.00:1, 366% above 4.5:1
Non-text (UI and graphics)Pass
21.00:1, 600% above 3:1

Hello World

The quick brown fox jumps over the lazy dog.

Small caption text — 14px equivalent

Color Blindness Simulation

Large text is at least 18 pt, or at least 14 pt and bold. Anything smaller is normal text.

AA Normal (4.5:1): Minimum for normal text.

AA Large (3:1): Minimum for large text.

AAA Normal (7:1): Enhanced contrast for normal text.

AAA Large (4.5:1): Enhanced contrast for large text.

Non-text (3:1): WCAG 2.2 criterion 1.4.11, for icons, input borders, focus indicators and graphics against the colour next to them.

The ratio is shown truncated to two decimals, and pass or fail uses the exact value.

About the Color Contrast Checker

WCAG level AA needs a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text, and level AAA needs 7:1 and 4.5:1. White on black is 21:1. The checker computes the exact ratio of two colors and shows it truncated to two decimals, never rounded up, so #ef0000 on white (4.4966:1) reads 4.49:1 and fails AA for normal text. A fifth card checks the 3:1 non-text rule for icons and borders, and a failing text color gets a suggested replacement.

WCAG 2.1 and 2.2 text contrast thresholds

LevelNormal textLarge text
AA (success criterion 1.4.3)4.5:13:1
AAA (success criterion 1.4.6)7:14.5:1

Large text is at least 18 pt, or at least 14 pt and bold. WCAG 2.2 keeps the same values.

Text colors on white: ratio and pass or fail

Text colorRatio shownAA normalAA largeAAA normalAAA large
#00000021.00:1PassPassPassPass
#5959597.00:1PassPassPassPass
#7676764.54:1PassPassFailPass
#7777774.47:1FailPassFailFail
#8080803.94:1FailPassFailFail
#9494943.03:1FailPassFailFail
#ff00003.99:1FailPassFailFail
#ef00004.49:1FailPassFailFail
#0000ff8.59:1PassPassPassPass

The ratio is the exact value truncated (not rounded) to two decimals; pass or fail uses the exact value. #ff0000 is 3.9985:1 and shows 3.99.

How to use this tool

  1. Enter the foreground (text) and background colors with the pickers or as hex codes, #RGB or #RRGGBB.
  2. Read the ratio and the five cards: AA normal, AA large, AAA normal, AAA large and Non-text (UI and graphics, 3:1), each marked Pass or Fail.
  3. If AA normal text fails, press Apply on the suggested text color: the nearest lightness of the same hue that reaches 4.5:1.
  4. For a semi-transparent color, set its opacity and, if the background is see-through, a backdrop color; the checker draws the background over the backdrop, then the text over that, and measures the result.

Frequently asked questions

What is the minimum contrast ratio for WCAG AA?
4.5:1 for normal text and 3:1 for large text. Large text is at least 18 pt, or at least 14 pt and bold. Text that is decoration, inactive or part of a logo has no contrast requirement.
What contrast ratio does WCAG AAA need?
7:1 for normal text and 4.5:1 for large text. #595959 on white is 7.0047:1, shown as 7.00:1, and passes; #767676 is 4.54:1 and passes AAA only for large text.
How is the contrast ratio calculated?
Each color’s red, green and blue values are linearized, then weighted as 0.2126 R + 0.7152 G + 0.0722 B to give a relative luminance L. The ratio is (L of the lighter color + 0.05) ÷ (L of the darker color + 0.05).
How do I fix a text color that fails AA?
Change its lightness until the ratio reaches 4.5:1. The checker does this for you when AA normal text fails: it keeps the hue and saturation, moves the lightness up or down, whichever needs the smaller change, and shows the nearest color that passes with an Apply button. Gray #aaaaaa on white (2.32:1) becomes #767676 (4.54:1), and red #ff0000 (3.99:1) becomes #ee0000 (4.53:1).
Why does a ratio that looks like 4.5 show as 4.49?
The page truncates the ratio to two decimals instead of rounding it, because WCAG says a computed ratio of 4.499:1 does not meet 4.5:1. #ef0000 on white is 4.4966:1, so it shows 4.49:1 and fails; a pair that shows 4.50:1 passes.
Does a passing ratio mean everyone can read the text?
No. A ratio is a minimum for one pair of colors. It says nothing about font size, weight, spacing or other vision needs, and the color-blindness previews on the page are an approximate preview, not a clinical simulation.

Related Tools

View all tools