WCAG Color Contrast Checker

Pick a text color and a background color to get their contrast ratio and see at a glance whether they meet the WCAG accessibility levels for normal text, large text and interface components. If a pair fails, the checker suggests the closest shade of your text color that passes AA.

Runs in your browser — nothing is uploaded

How to use it

  1. Enter the text color and the background color as HEX (#1E293B, #FFF) or rgb(30, 41, 59), or use the color pickers.
  2. Read the contrast ratio and the pass or fail result for each WCAG level.
  3. Check the live preview with large text, normal text and a button outline.
  4. If the colors fail, press “Use this color” to apply the suggested shade, or swap the colors with ⇄.

Common uses

  • Checking brand colors for readable text before a website launch.
  • Making buttons, links and form borders accessible.
  • Fixing accessibility audit findings about low contrast.
  • Choosing text colors for slides, posters and social graphics.
  • Testing dark-mode color pairs.

Examples

Text on backgroundContrast
#000000 on #FFFFFF21.00:1 · passes everythingThe maximum possible contrast.
#777777 on #FFFFFF4.47:1 · fails AA for normal textPasses for large text (3:1).
#767676 on #FFFFFF4.54:1 · passes AAThe lightest gray that passes AA on white.
#FFFFFF on #0EA5E92.77:1 · fails AAWhite text on a light blue button is too faint.
#595959 on #FFFFFF7.00:1 · passes AAA

Frequently asked questions

What contrast ratio does WCAG require?

For level AA, normal text needs at least 4.5:1 and large text (about 24 px, or 18.5 px bold) needs 3:1. Level AAA needs 7:1 for normal text and 4.5:1 for large text. Icons, form borders and other interface components need 3:1.

How is the contrast ratio calculated?

Each color's relative luminance is computed from its red, green and blue values, then the ratio is (lighter + 0.05) ÷ (darker + 0.05). It ranges from 1:1 (same color) to 21:1 (black on white).

Why does 4.47:1 fail when it is so close to 4.5?

WCAG thresholds are strict and must not be rounded up. That's why the checker truncates the displayed ratio: #777777 on white is 4.47:1 and fails, while #767676 reaches 4.54:1 and passes.

How does the color suggestion work?

It keeps the hue and saturation of your text color and changes only its lightness, by the smallest amount needed to reach 4.5:1 against your background.