Skip to content
hexcolorcodepicker.com

How to Check Contrast for Readable Text

What is a contrast ratio?

A contrast ratio measures how different text looks from its background, on a scale from 1:1 to 21:1. A ratio of 1:1 means the text and background are identical, and 21:1 means black text on white. Higher ratios are easier to read.

The ratio is calculated from the relative luminance of the two colors, which is how bright each color looks to the eye. It is not a simple difference between two HEX codes, so you cannot judge it by eye alone. Two colors that look far apart on a swatch can still fail, and two close colors can pass, which is why you must measure the pair. Try the picker on the Hex Color Code Picker homepage, then measure the pair you picked.

Contrast ratio slider

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

WCAG AA: the minimum you must meet

WCAG AA needs a contrast ratio of at least 4.5:1 for normal text and at least 3:1 for large text. AA is the standard most websites aim for, and it is the level required by most accessibility laws and policies. Anything below it is hard to read for many people.

Normal text means body copy and anything smaller than large text, while large text means text at least 18 point, or 14 point bold, and larger. Large text gets the lower 3:1 bar because bigger, bolder letters are easier to read at lower contrast. AA is the practical minimum: it keeps text readable for people with low vision without forcing every design into black and white.

AA threshold bar

1:13:1 AA large4.5:1 AA normal7:1 AAA normal21:1

WCAG AAA: the stricter level

WCAG AAA needs a contrast ratio of at least 7:1 for normal text and at least 4.5:1 for large text. AAA is the highest WCAG level, and it is the right target for body text on sites where reading matters most, such as government and education pages.

AAA is harder to meet because 7:1 leaves little room for light gray text or soft brand colors. Most websites do not need AAA everywhere, but body paragraphs and long articles benefit from it. If your brand color cannot reach 7:1 as text, use it for headings, icons, or large text instead, and keep body text at AAA with a darker color.

AA vs AAA comparison

Reading should feel easy, not tiring. This paragraph is set in the gray that meets the level above, on a white background, so you can feel the difference between AA and AAA.

Worked pairs: four pairs, four verdicts

White on red is 4.00:1, white on yellow is 1.07:1, black on yellow is 19.56:1, and white on #3b5bdb is 5.67:1. The first fails AA for normal text, the second fails everything, the third passes AAA, and the fourth passes AA for normal text.

White on red at 4.00:1 fails AA for normal text (bar 4.5:1) but passes AA for large text (bar 3:1). White on yellow at 1.07:1 is almost no contrast at all, so it fails AA and AAA at every size. Black on yellow at 19.56:1 is nearly the highest possible ratio, so it passes AAA with room to spare. White on #3b5bdb at 5.67:1 clears 4.5:1, so it passes AA for normal text.

How to check contrast step by step

Pick your text and background colors, measure the ratio, and compare it with the AA and AAA bars for the text size you use. Check normal and large text separately, because a pair can pass at one size and fail at the other. Check the real page, not just the swatch.

First, enter the exact HEX codes from your design, not a color that looks close. Second, read the ratio and the pass or fail badges for normal and large text. Third, test the pair at its real size and weight on the page, because thin text at small sizes is harder to read than the ratio alone suggests. Finally, test hover and disabled states too, since they often use lighter colors that fail. Use the Contrast Checker for the measurement step.

Step-by-step checker

  1. Step 1 — Enter two HEX codes:
  2. Step 2 — Read the ratio: —
  3. Step 3 — Read the verdicts: —
  4. Step 4 — Preview the pair:

Body text in this pair — the quick brown fox jumps over the lazy dog.

Heading in this pair

Button in this pair

How to fix a failing pair

To fix a failing pair, darken the text, lighten the background, or make the text larger and bolder. Change one side at a time and re-measure after each change, because a small shift is often enough to cross the bar.

If white text on a brand color fails, darken the brand color for text use while keeping the bright version for backgrounds and accents. If light gray body text fails, darken the gray before you change anything else, because gray text is the most common failure. If a pair passes for large text but fails for normal text, use it only for headings and pick a darker color for body copy. Never fix contrast by adding a shadow or outline and calling it done.

Fix-it slider

The quick brown fox jumps over the lazy dog.

Beyond contrast: do not rely on color alone

Do not rely on color alone to carry meaning, because some readers cannot see the color difference at all. Use labels, icons, and underlines alongside color, so the meaning survives even when the color does not.

A form field that turns red for an error means nothing to a reader who cannot tell red from green, and a chart that uses only color to separate lines is unreadable to a color-blind reader. Add a text label that says the error, an icon next to the warning, and an underline on links so they do not depend on color. This rule is part of WCAG 2.2, and it matters even when every pair on the page passes its contrast ratio.

Next, read How to Choose Colors for a Website.

Color alone vs color plus label

Color only

Email address

● ● Two chart lines, red and green — which is which?

Color plus label

⚠ Email address — enter a valid email

Underlined link · ▲ Sales, ■ Costs — labeled lines

With color vision simulated, the color-only version loses its meaning — the error and the chart lines blend together. The labeled version keeps it: the warning text, the icon, and the underline are still there.

Frequently asked questions

You need at least 4.5:1 for WCAG AA and at least 7:1 for WCAG AAA. Normal text means body copy and anything smaller than large text. If your pair is below 4.5:1, darken the text or lighten the background until it reaches the bar.