HIYSL REFERENCE / FIELD NOTES

How to Check Text and Background Contrast for Readability

On this page
AI-generated illustration; not taken on location · Illustration comparing the same text against light and dark backgrounds.
AI-generated illustration; not taken on location · A conceptual comparison of text and background contrast.AI-generated illustration

To check contrast, identify the color of the text and the background directly behind it, then use a contrast checker that can accept those colors and report a ratio. Compare that result with the WCAG requirement that applies to your text and your chosen conformance level. If it falls short, adjust one of the colors and check the new pair.

A useful result depends on checking the colors people will actually encounter, not just a pair you intended to use. Pay particular attention to text over changing backgrounds, small labels, and any message that relies on color to communicate meaning. A contrast check is a helpful part of a readability review, but it is not a complete accessibility review.

Identify the colors to check

Start with one piece of text and the background immediately behind it. Write down what the text is, where it appears, and which background you are checking. For example, you might begin with the words on a button and the button’s own background, rather than the background of the surrounding page.

Find the actual color values used for both parts of the pair. If you can inspect the design or its color settings, look for the text and background values there. A color picker may also help you identify colors, depending on what it can sample and how it reports the result. Confirm that any value you copy corresponds to the element you want to check; a nearby border, image, or container is a different color choice.

When the background changes

If text appears over a photograph, pattern, gradient, or other changing background, there may be no single background color that represents every part of the text. Identify the areas immediately behind the lettering and check the relevant combinations. Consider whether the image, crop, text position, or background can change in another version of the design.

If you cannot determine the colors reliably, ask whoever can access the design or its settings for the actual values. Keep a short record of each pair and where it appears. That makes it easier to review revisions and avoids treating an approximate sample as though it necessarily represents every instance.

Check the pair

Open a contrast checker and look for its instructions for supplying a text color and a background color. The labels, accepted formats, controls, and placement of the result depend on the checker, so confirm those details in the tool you are using. If it accepts the values you recorded, enter each one in the corresponding place and locate the reported contrast ratio.

Before interpreting the result, compare the values displayed by the checker with your notes. Make sure you have checked the intended text against the background immediately behind it. If you copied a value from a color picker, verify that the checker accepts it as intended rather than assuming the transfer worked.

Keep the result tied to its example

Record the ratio alongside the text, its background, and the context in which they appear. If the checker presents additional assessments, note which text category and conformance level each assessment refers to. A result is more useful when you can later tell exactly which pair and use it describes.

Repeat the process for another pair if the same text color appears on a different background. Likewise, check a different text color used against the same background. For changing backgrounds, use the relevant combinations you identified rather than recording one result for the entire image.

If the tool’s input or result is unclear, consult its instructions or choose a checker whose interface you can verify. Avoid guessing which number is the ratio or assuming that an unlabeled assessment applies to every piece of text.

Interpret the result for your text

A ratio needs context before it can answer whether a particular use meets your target. Identify the applicable WCAG conformance level and whether the text qualifies as normal or large under the relevant criterion. Then compare the ratio with the threshold for that combination. Minimum and enhanced levels are separate targets, so make a deliberate choice about which one you are checking.

Do not decide that text is large simply because it looks prominent in the design. Check the applicable WCAG criterion for how the category is determined, using the actual text settings. If you cannot confirm those settings, ask for them before relying on a large-text assessment. The Section508.gov guide to accessible color usage is an official place to start your review.

If a pair meets one threshold but not another

Suppose your checker indicates that a pair meets the applicable large-text threshold but falls short of the normal-text threshold. First confirm that the assessment corresponds to your chosen conformance level. Then verify the category of the actual text. If it qualifies as large, compare the result with the requirement for that use; if it is normal text, revise the pair and check again against the normal-text target.

Where the same colors are used for both categories, assess each use against its applicable requirement. Keep the different uses in your notes so a result for a prominent heading is not mistaken for a result covering smaller supporting text. If the intended category or target remains unclear, resolve that question before treating the check as complete.

Adjust and check again

When the result falls short of your target, change the text color, the background color, or both, and submit the revised pair for another check. Contrast ratios use relative luminance, so adjusting the lightness of one color is a practical place to start. Keep the original values and result in your notes so you can compare alternatives and return to an earlier version if necessary.

Choose which color to adjust based on the job the pair needs to do. If the background is a photograph you cannot change, consider changing the text treatment or adding a background behind the text, then check the resulting combination. If the text color needs to remain consistent across several places, consider whether the relevant backgrounds can be changed instead. These are choices to evaluate in the actual design, not assumptions that one adjustment will work everywhere.

Use a repeatable revision loop

  1. Change one color and record the new value.
  2. Check it against the other color and record the ratio.
  3. Compare the result with the threshold for the actual text and target level.
  4. If it still falls short, make another adjustment and check again.
  5. Review each place where the revised color is used, including other backgrounds or text colors it appears with.

A palette generator may help you explore alternatives if it supports the kind of choices you need. Confirm the colors it provides and check each relevant pair independently. Once a pair reaches the applicable target, review it in context as well: the numbers describe the checked colors, while the surrounding presentation still deserves attention.

Check the context around the colors

A passing ratio answers a specific question about the colors and criterion you checked. It does not establish that the whole page is accessible: a page can appear to pass quick checks and still present significant accessibility barriers. Review the text in its setting, including whether the message is understandable and whether the relevant combinations have all been considered.

Look beyond the first example. Check headings and supporting copy separately when their colors, backgrounds, or applicable text categories differ. Review text on buttons and other controls, as well as text over images or changing backgrounds. If a design has alternate versions, identify any color pairs that change and check those uses too.

When color carries meaning

If color distinguishes a status, choice, or message, provide a label or another visual cue that makes the meaning clear without requiring the reader to interpret color alone. For example, a status can include a word such as “Complete” alongside its color. Check the label’s text and background contrast as a separate pair.

Ask a few practical questions before finishing:

  • Have I checked the colors directly behind the text in each relevant setting?
  • Does each result correspond to the actual text category and the conformance level I chose?
  • If the background changes, have I considered the different combinations the text may appear over?
  • If color communicates meaning, is that meaning also clear from a label or another cue?
  • Have I reviewed the surrounding experience rather than treating a ratio as a complete accessibility assessment?

Keep your notes with the design or content being reviewed. When either color, the text treatment, or its background changes, return to the relevant pair and check it again.

Sources