Accessible color contrast

WCAG Color Contrast Checker

Pick a text and background color to see the contrast ratio and whether it passes WCAG instantly. If it falls short, you get the closest color that passes.

Contrast ratio

5.16:1

  • Normal text AA4.5:1Pass
  • Normal text AAA7:1Fail
  • Large text AA3:1Pass
  • Large text AAA4.5:1Pass
  • Icons & UI borders3:1Pass

Large text 24px

This is a 16px body text preview. When text and background contrast is too low, content disappears in sunlight and for people with low vision.

Small text 13px · captions and hints

Button border

Text colors that pass

The background stays as is; these are the closest text colors that meet each level. Click one to apply it.

CSS code

color: #2563EB;
background-color: #FFFFFF;

Color contrast chart on white and black

Contrast ratios of common colors used as text on a white (#FFFFFF) and a black (#000000) background. Because the ratio is the same either way round, the white column is also the ratio for white text on that color.

FamilyColorText on whiteText on black
Gray#11182717.73:1 AAA1.18:1 Fail
#37415110.30:1 AAA2.03:1 Fail
#4B55637.55:1 AAA2.77:1 Fail
#6B72804.83:1 AA4.34:1 Large only
#7676764.54:1 AA4.62:1 AA
#9999992.84:1 Fail7.37:1 AAA
#9CA3AF2.53:1 Fail8.27:1 AAA
#D1D5DB1.47:1 Fail14.25:1 AAA
Blue#1D4ED86.70:1 AA3.13:1 Large only
#2563EB5.16:1 AA4.06:1 Large only
#3B82F63.67:1 Large only5.70:1 AA
#2196F33.12:1 Large only6.72:1 AA
#60A5FA2.54:1 Fail8.25:1 AAA
Red#B91C1C6.47:1 AA3.24:1 Large only
#DC26264.82:1 AA4.34:1 Large only
#EF44443.76:1 Large only5.58:1 AA
Green#15803D5.01:1 AA4.18:1 Large only
#16A34A3.29:1 Large only6.37:1 AA
#22C55E2.27:1 Fail9.21:1 AAA
Orange#C2410C5.17:1 AA4.05:1 Large only
#EA580C3.55:1 Large only5.89:1 AA
#F973162.80:1 Fail7.49:1 AAA
Yellow#A162074.92:1 AA4.26:1 Large only
#CA8A042.93:1 Fail7.14:1 AAA
#EAB3081.91:1 Fail10.95:1 AAA
#FACC151.53:1 Fail13.71:1 AAA
Purple#6D28D97.10:1 AAA2.95:1 Fail
#7C3AED5.69:1 AA3.68:1 Large only
#8B5CF64.23:1 Large only4.95:1 AA

AA means the normal-text level (4.5:1). Large only means 3:1 or more, which is fine only for text 24px and up or bold text 18.7px and up. The lightest gray that passes AA on white is #767676 (4.54:1); the popular #999999 fails at 2.84:1.

WCAG contrast requirements

LevelNormal textLarge textIcons, borders and graphics
AA (1.4.3)4.5:13:13:1 (1.4.11)
AAA (1.4.6)7:14.5:1-
  • Large text: 18pt (24px) and up, or bold 14pt (about 18.7px) and up.
  • AA: the baseline most accessibility laws and audits require.
  • AAA: a higher target for services where readability matters most, such as government and education.
  • Exceptions: disabled controls, decorative text, logos and text that is part of a photo are not covered.

How the contrast ratio is calculated

ratio = (L of lighter color + 0.05) ÷ (L of darker color + 0.05)

L is relative luminance: convert R, G and B to 0–1, undo the gamma curve, then compute 0.2126 × R + 0.7152 × G + 0.0722 × B. Green carries by far the most weight, so greenish colors like yellow and lime come out brighter than you might expect and fail on white most of the time.

For example, white (L = 1) against #2563EB (L ≈ 0.153) gives (1 + 0.05) ÷ (0.153 + 0.05) ≈ 5.16:1, which passes AA. Displayed values are truncated to two decimals, so a value just below the line such as 4.499 never shows up as 4.50.

How to fix low contrast

  • Gray text: light gray for secondary copy is the most common failure. On white, use a gray darker than #767676.
  • White text on brand colors: white on orange, yellow or light green almost always fails. Use a darker shade of the same hue as the background, or switch the text to near-black.
  • Input placeholders: placeholder text is still text and needs 4.5:1. Default browser placeholder colors often fall short.
  • Text over images: check against the brightest part of the photo and add a translucent overlay such as rgba(0, 0, 0, 0.5).
  • Design systems: check each step of your palette here before handoff so you don't have to change colors during development.

FAQ

What does a 4.5:1 contrast ratio mean?

It means the relative luminance of the lighter color is 4.5 times that of the darker one (after adding 0.05 to each). Identical colors score 1:1 and black on white scores the maximum, 21:1. Normal text needs at least 4.5:1 to pass WCAG AA.

What counts as large text in pixels?

WCAG treats text as large at 18pt (24px) and up, or 14pt (about 18.7px) and up when bold. Large text is easier to read because the strokes are bigger and thicker, so the AA requirement drops to 3:1.

Should I aim for AA or AAA?

AA is the level that accessibility laws and audits usually require, including the ADA, Section 508 and the European Accessibility Act via EN 301 549. AAA (7:1) is strict enough to rule out most brand colors, and W3C does not recommend requiring it for all content. Always meet AA for body text, and get close to AAA on screens built for long reading.

Do icons and input borders have a contrast requirement?

Yes. WCAG 2.1 success criterion 1.4.11 Non-text Contrast requires graphics people need to see, such as icons, input borders, checkboxes and chart lines, to have at least 3:1 contrast against adjacent colors. Disabled controls and purely decorative elements are exempt.

Does swapping text and background colors change the ratio?

No. The ratio depends only on the difference in luminance, so blue text on white and white text on blue give the same value. The white-background column in the table below is also the ratio for white text on that color.

Is WCAG 3 changing how contrast is measured?

WCAG 3 is still a draft and has been exploring a different method called APCA. Until it becomes a standard, laws and audits keep using the WCAG 2.x ratios this checker uses: 4.5:1 for normal text and 3:1 for large text and UI.

Related tools