Skip to content
Gizmetto

Color Contrast Checker

Test a text color on a background against WCAG 2.2, see where it passes, and get the closest color that does.

2.86:1: fails AA for all text

Text
Background

Large text, 24 px (18 pt)

Normal text at 16 px. This is how a paragraph reads in these two colors on a screen.

Button outline

Contrast ratio

2.86:1

  • AANormal textFail 4.5:1
  • AALarge textFail 3:1
  • AAANormal textFail 7:1
  • AAALarge textFail 4.5:1
  • AAUI and graphicsFail 3:1

Nearest passing color

Text color: #ce4c00 4.50:1

Or background: #313131 4.53:1

Palette grid

Every text color (rows) on every background (columns), with the best text level each pair reaches.

Contrast ratio of each text color (rows) on each background color (columns)
Text color#1e1c19#ffffff#ff6a13#f2e5c3#2f7a3a#6fb1ff
#1e1c19Same colorAa16.99:1AAAAa5.92:1AAAa13.57:1AAAAa3.21:1AA largeAa7.61:1AAA
#ffffffAa16.99:1AAASame colorAa2.86:1FailAa1.25:1FailAa5.29:1AAAa2.23:1Fail
#ff6a13Aa5.92:1AAAa2.86:1FailSame colorAa2.29:1FailAa1.84:1FailAa1.28:1Fail
#f2e5c3Aa13.57:1AAAAa1.25:1FailAa2.29:1FailSame colorAa4.22:1AA largeAa1.78:1Fail
#2f7a3aAa3.21:1AA largeAa5.29:1AAAa1.84:1FailAa4.22:1AA largeSame colorAa2.37:1Fail
#6fb1ffAa7.61:1AAAAa2.23:1FailAa1.28:1FailAa1.78:1FailAa2.37:1FailSame color

Ratios follow the WCAG 2.2 formula and are cut, not rounded, to two decimals, so 4.499 never shows as a pass.

How to check color contrast

Contrast is how far apart two colors are in brightness. WCAG measures it as a ratio from 1:1 (the same color) to 21:1 (black on white). This checker works it out with the formula in the WCAG 2.2 Recommendation, for any two colors you give it.

  1. Step 1Set the two colorsPick each color, or type it as hex, RGB or HSL. Swap turns text into background and back.
  2. Step 2Read the ratioThe ratio and five pass or fail lamps update at once, with a live sample of text and a button.
  3. Step 3Fix a failPick a target and tap Use it to take the nearest text or background color that reaches it.
Color contrast checker with orange text on white at 2.86:1, failing all five WCAG checks, the nearest passing text color and background suggested, and a palette grid of six colors
Orange on white fails at 2.86:1. The checker suggests a darker orange at 4.50:1 and tests the whole palette below.

The math follows the definitions in WCAG 2.2. Each channel is turned into linear light, the three are weighted 0.2126 for red, 0.7152 for green and 0.0722 for blue to get the relative luminance, and the ratio is the lighter luminance plus 0.05 divided by the darker plus 0.05. The checker is unit tested on known pairs: grey 777777 on white is 4.48:1 and just fails AA, while 767676 is 4.54:1 and passes.

WCAG AA and AAA contrast levels

WCAG 2.2 has three success criteria for contrast. These are the ratios in the W3C Recommendation of 12 December 2024, which we read on October 23, 2026:

WCAG 2.2 contrast success criteria, their level and the minimum ratio
Success criterionLevelApplies toMinimum
1.4.3 Contrast (Minimum)AANormal text4.5:1
1.4.3 Contrast (Minimum)AALarge text3:1
1.4.6 Contrast (Enhanced)AAANormal text7:1
1.4.6 Contrast (Enhanced)AAALarge text4.5:1
1.4.11 Non-text ContrastAAUI components and graphics3:1

Large scale text is at least 18 point, or 14 point bold: 24 CSS pixels, or about 18.7 pixels in bold. Non-text contrast covers what you need to see to use a control, such as the border of a text field or the shape of an icon, and the parts of a chart or graphic that carry meaning. WCAG itself does not recommend requiring AAA for whole sites, because some content cannot meet every AAA criterion.

Nearest passing color

When a pair fails, the checker suggests two fixes: a new text color for the same background, and a new background for the same text. Both keep the hue and saturation and only change the lightness, so a brand orange stays orange, just darker or lighter. Choose the target first: 4.5:1 for normal text, 7:1 for AAA, or 3:1 for large text and UI parts.

Text on a thumbnail or a banner works the same way. Test it against the color right behind the words, then check it at a small size in the YouTube thumbnail preview.

Test a whole palette

The palette grid takes up to 10 colors and tests every pair at once: each row is a text color, each column a background. Every cell shows the text in its real colors with the ratio and the best level it reaches: AAA, AA, AA large (3:1, large text and UI only) or Fail. Paste your brand colors to see which pairs you can use for body text and which only for headings or not at all.

FAQ

What contrast ratio do I need?

For WCAG 2.2 level AA, 4.5:1 for normal text and 3:1 for large text, buttons, form borders and icons. For level AAA, 7:1 for normal text and 4.5:1 for large text.

What counts as large text?

WCAG defines large scale text as at least 18 point, or 14 point bold. On the web, 18 point is 24 CSS pixels and 14 point is about 18.7 CSS pixels.

Why does 4.49 fail when it is almost 4.5?

Because the thresholds are minimums. The checker cuts the ratio to two decimals instead of rounding it, so a pair at 4.499 shows 4.49:1 and fails, as it should.

How is the nearest passing color found?

The checker keeps the hue and saturation of your color and tries every lightness from black to white in steps of 0.1 percent. It keeps the one that reaches the target with the smallest change. When no lightness of that hue reaches the target on your background, it says so.

Does it check transparent colors or text on photos?

No. It compares two solid colors. For text on a photo, test the text color against the lightest and the darkest part of the image behind it.

Related tools

All creator tools

Maintained by Updated Oct 23, 2026.