All Articles
Developer

Check Text and Background Color Contrast

December 1, 20263 min read

Color Converter with HEX #767676 entered; Contrast Analysis shows Ratio 4.54:1 WCAG AA on white, 4.62:1 WCAG AA on black and 1.15:1 Poor on gray

Enter a text color in the Color Converter and its Contrast Analysis panel shows the ratio of that color, used as text, against three fixed backgrounds: white, black and gray. The tool cannot test two arbitrary colors against each other, so it answers a narrower question: is this text color readable on white or black? WCAG AA asks for at least 4.5:1 for normal text and 3:1 for large text.

Try a pair on each side of the line

  1. Open the Color Converter. In Color Input, leave Input Format on HEX.
  2. Type #767676 in Color Value. Under Contrast Analysis, the white card reads Ratio: 4.54:1 ✅ WCAG AA and the black card reads 4.62:1 ✅ WCAG AA.
Color Converter with HEX #777777 entered; Contrast Analysis shows Ratio 4.48:1 Poor on white, 4.69:1 WCAG AA on black and 1.13:1 Poor on gray
  1. Change the value to #777777, one step lighter. The white card now reads Ratio: 4.48:1 ❌ Poor. The two grays look identical to most people, yet one passes AA for normal text on white and the other does not.

What to do with the number

  • For body text on a white background, use the white card. For light text on a dark page, use the black card.
  • For large text (about 24px, or 19px bold) the threshold is 3:1, but the card still prints Poor under 4.5:1. Compare the number yourself in that case.
  • The third card compares against #808080 and uses the page's own gray, which looks slightly different on screen. Treat that one as a rough guide, not a verdict.
Advertisement

Limits

This is not a full accessibility audit. The tool only checks text color against white, black and one gray, and does not test your real background, font size, hover, disabled or keyboard-focus states. Test your actual component in the browser, and do not rely on color alone to carry meaning.

If it doesn't work

  • If the cards do not update, the HEX value must be 3 or 6 digits, such as #777 or #777777.
  • If your color is in RGB or HSL, change Input Format first, or copy the HEX from Color Formats.
  • If your background is neither white nor black, calculate the ratio with a tool that accepts two colors, or compare against the WCAG formula.
Advertisement
Color ConverterAccessibilityDeveloper Tools