Light gray text on a white background is the most common readability failure on the web, and it is also the easiest to prevent. It takes one minute to check a color pair and one minute to fix it — yet pale, low-contrast text ships on real websites every day, quietly excluding the readers with older eyes, dim screens, or bright sunlight. This guide gives you the numbers to remember, the 60-second check, and the fixes that work without redesigning anything.

What a contrast ratio actually measures

A contrast ratio compares the brightness of text against the brightness of its background, on a scale from 1:1 (identical colors, invisible) to 21:1 (pure black on pure white, the maximum). The ratio is calculated from the two colors’ relative luminance — roughly, how much light each one reflects — with a formula that matches how human eyes actually perceive brightness. Two colors can look different yet still fail, because hue differences do not count the way brightness differences do: red text on green text looks loud but measures poorly, because the two colors are similar in brightness.

That is the first thing to understand about contrast: it is about luminance, not color. A dark blue on a white background passes easily even though the colors are different. A medium gray on a white background fails even though it looks clearly visible on a good monitor in a dark room. The ratio catches what your eyes miss, which is exactly why you should measure it instead of guessing.

The WCAG numbers to remember

The Web Content Accessibility Guidelines (WCAG) set the standard, and there are only three numbers worth memorizing:

AA is the legal and practical baseline in most places, and it is the target to design for. AAA is the aspiration. Note that large text gets the easier 3:1 threshold because bigger letters are inherently more readable — a headline in medium gray can pass where the same gray in body text fails. But that is not a loophole: body text is where most of your words live, so 4.5:1 is the number that governs your design.

The 60-second check

Checking a pair takes less than a minute with a contrast checker tool:

  1. Enter the text color and the background color as hex codes, for example #595959 on #FFFFFF.
  2. Read the ratio. The tool gives you the number and tells you whether it passes AA and AAA for normal and large text.
  3. Check every text color in your design, not just the body text. Links, captions, placeholders, button labels, and footer text are the usual failures, because they are the colors designers lighten for style.
  4. Check text over images and gradients too, using the lightest part of the image behind the text — that is the worst case, and the worst case is what fails.

Run the check on the colors you actually ship, not the colors in your design file. Brand guidelines drift, developers approximate hex codes, and transparency changes effective colors. A five-minute pass over the live site catches the gray-on-white footer and the pale placeholder text that nobody noticed during design review.

Worked example: fixing a failing button

Take a common failure: medium gray text (#999999) on a white button. The ratio is 2.85:1 — it fails the 4.5:1 bar for normal text by a wide margin. It looks fine on a bright monitor in a dark room, which is how it shipped. On a phone in sunlight, it is nearly unreadable.

The fix is to darken the text, not to redesign the button. Stepping down to #767676 gives 4.54:1 — just over the AA line. Stepping to #595959 gives 7:1, the AAA standard, and the button still looks essentially the same: gray text on white, just a shade darker. The lesson is that the distance between failing and passing is usually one or two shades. You almost never have to change the design; you just have to darken the text until the number clears the bar.

The same principle works in the other direction. White text on a light brand color fails the same way — a pale blue button with white text might measure 2:1. The fix is to darken the button’s background, or to switch the text to a dark color. Either way, measure after the change; a single shade can be the difference between 4.2:1 and 4.6:1.

The usual suspects: where low contrast hides

Low contrast is rarely in the main body text, which designers usually set in near-black. It hides in the secondary text:

Fixing low contrast without redesigning

When a pair fails, you have four levers, and the first two fix most cases:

  1. Darken the text. The simplest fix. Move the text color one or two shades darker and re-measure. It preserves the design and the brand palette.
  2. Lighten or darken the background. If the text must stay light, darken the background behind it. A slightly darker button or a tinted card gives the text the contrast it needs.
  3. Add a scrim. For text over images, add a semi-transparent dark overlay (a scrim) behind the text, or a subtle text shadow. The image stays visible and the text becomes readable.
  4. Make the text bigger or bolder. Large text only needs 3:1, so bumping a caption from 12px to 18px, or from regular to bold, can move it from failing to passing — though this is a workaround, not a substitute for real contrast on body text.

One thing not to do: do not rely on the user to fix it. Browser zoom and high-contrast modes exist, but most readers will not turn them on for your site. Contrast is your responsibility, and the check takes sixty seconds. Run it before you ship, and the text you worked so hard to write will actually be read.

AdvertisementAd slot: in-content

Frequently asked questions

What is a good contrast ratio for text?

Aim for at least 4.5:1 for normal body text, which is the WCAG AA standard and the minimum most readers need. Large text, 18pt or larger, only needs 3:1. If you can reach 7:1, the stricter AAA standard, do it — that level stays readable in bright sunlight and for readers with low vision.

Does contrast matter for large text?

Yes, but the bar is lower. Large text only needs a 3:1 ratio, because bigger letters are inherently easier to read. That means a medium gray that fails in body text can pass as a headline. But do not use it as a loophole: most of your words are body text, and body text needs 4.5:1.

Why does my brand color fail the contrast check?

Brand colors are usually chosen to look good, not to be readable, and many sit in the middle brightness range where contrast against white is weak. A pastel or mid-tone brand color can measure 2:1 against white. The fix is to use a darker shade of the same color for text, and keep the bright brand color for accents, borders, and large shapes.

Is contrast only about text?

No. WCAG also requires a 3:1 ratio for user-interface components: buttons, form field borders, icons, and focus indicators. A form field with a pale gray border is hard to find, and a focus ring that blends into the background defeats its purpose. Check your interactive elements with the same tool you use for text.