FIELDNOTES / GUIDE

How to Check Text Contrast in a PDF Document

Contents
AI-generated illustration; not taken on location · Illustration comparing pale and dark text on a light background.
AI-generated illustration; not taken on location · A conceptual comparison of weak and strong text contrast.AI-generated illustration

To check text contrast in a PDF, identify the color of the text and the color immediately behind it, then enter or sample both colors in a contrast checker. Read the ratio alongside the result for the relevant text category, and repeat the check wherever the combination changes.

A straightforward page may have only a few combinations to review. A document with photographs, gradients, transparent layers, or scanned pages needs closer inspection because one pair of colors may not represent all the visible text. This guide walks through a practical check, what to do when you cannot recover the original colors, and how to verify changes in the finished PDF.

Find the text and backgrounds to check

Start by opening the PDF and looking through the whole document. Note each distinct text style and the background directly behind it. A heading on a white page, a caption over a photograph, and a link inside a colored box are separate combinations to consider. Check small labels and other text as well as the main paragraphs.

A simple review list can help you keep track:

What to record Example
Text location and style Heading on the first page
Immediate background Light-colored box behind the heading
Colors to compare Heading color and box color
Follow-up Check the applicable result and record any changes

The immediate background is the area the letters actually sit on. If a page has a white margin but the words appear inside a colored panel, compare the text with the panel, not the margin. If a heading crosses from a plain area into an image, note both portions for review.

Repeated styles can make the task easier to organize, but check whether the background changes between occurrences. The same text color may need a separate comparison when it appears on a different panel or another part of an image. Keep a note of the page and location for each concern so you can find it again after making corrections.

Capture the colors and compare them

If you have reliable color codes for the text and its background, use those as inputs to a contrast checker. Otherwise, a screen eyedropper can help you capture colors from the displayed PDF. The foreground is the text color; the background is the color directly behind it.

Sample a color pair

  1. Open the PDF to the text you want to check and make the relevant area easy to see on screen.
  2. Use a foreground eyedropper to click the text. If you already know the foreground hex code, enter it instead where the checker accepts one.
  3. Use a background eyedropper to click directly behind the same text. Avoid choosing a neighboring panel or a margin that is not behind the letters.
  4. Enter or confirm both colors in the checker and note the calculated ratio and the results shown for the relevant categories.
  5. Repeat for other combinations on your review list.

If selecting an individual letter is awkward, adjust the view and sample carefully. Check a few points on the visible text and background when you are unsure that a single click captured the intended colors. Record the location and sampled values, so another person can repeat the comparison or help investigate an uncertain result.

Interpret the result

A contrast checker can report a ratio and pass-or-fail results for different text or component categories. Read the result that applies to the item you are checking rather than assuming every result on the screen applies to every word. For example, a result shown for a component should not automatically be used as the result for a paragraph.

If the checker distinguishes ordinary and large text, determine which category applies before deciding whether the combination passes. Check the relevant accessibility guidance and the text’s actual formatting; if you cannot establish the size or formatting from the PDF, ask the document owner or check the source. Treat an uncertain category as a reason for further review, not as a confirmed pass.

Handle images and transparency

Text over a photograph or gradient needs more than one carefully chosen comparison. The background can vary across the words, so a sample from a clear area beside a caption may not represent the area behind every letter.

Look along the full span of the text and identify places where the text and background appear closest in color. Sample the background directly behind those portions, then compare each sample with the corresponding visible text color. Also check other visibly different areas behind the same text. For a title crossing a photograph, for example, review the letters over both a light area and a darker area rather than relying on a single background sample.

Keep the samples tied to their locations. If one comparison is weak, note which words or letters it affects and consider whether the design can give the entire title a more consistent background. A solid panel behind the text, a change of text color, or moving the text to a more suitable area are possible approaches; the resulting PDF still needs to be checked.

Transparency calls for similar care. When a transparent layer is involved, compare the colors as they appear together in the PDF, including the background visible through the layer. Check more than one location if that appearance changes. A color specified for a layer alone may not describe the visible combination you need to assess.

Sampling helps identify troublesome areas, but a few points do not establish that every letter over a changing background meets the relevant requirement. For a formal assessment or a complex layered design, consult the applicable technical guidance and seek a more detailed review.

Check scanned pages

A scanned page can present two related tasks: examining the contrast of the visible words and determining whether the PDF contains text that can be selected or recognized. Work through both questions rather than treating a successful color comparison as a complete text check.

Try selecting a passage with your mouse, or use Select All and inspect the result. If you can select the expected words, use the ordinary contrast workflow on their visible foreground and immediate background. If selection is difficult or does not identify the expected text, note the page for further investigation. That test helps you look for text; it does not by itself settle every accessibility question.

When pages lack renderable content, optical character recognition, or OCR, is a step to consider. Review the recognized text against the page, especially where the original words are hard to read. If recognition is inaccurate, improve the source or seek a clearer version where possible, then repeat the recognition and review process.

You can still inspect the visible scan for contrast. Sample representative areas of the displayed words and the paper or other background directly behind them, paying attention to places that look faint or uneven. Record uncertainty if the colors vary across the scan or are difficult to sample reliably. Recognition and visible contrast are separate checks: an OCR result does not replace a review of how the words appear, and a contrast ratio does not verify that the recognized words are correct.

Correct weak contrast and recheck the PDF

When a combination has a weak result, return to the source document if it is available. Change the text color, the immediate background color, or both, then compare the proposed pair again. For text on an image, consider a consistent panel behind the words or another placement that makes the background easier to assess. Choose changes that preserve the reader’s ability to distinguish the text from its surroundings.

Work through your review list rather than changing only the first example you find. A color used in a heading may also appear in captions or links, but each use should be considered against its own background. Keep a record of the old and revised combinations and the locations affected; that makes the final review easier to organize.

Produce an updated PDF from the revised source and open it for another check. Return to each affected location, sample or enter the relevant colors, and read the result for the applicable text category. Inspect the full span of text over images or changing backgrounds again. Also look at other places where the same design change was used, since the background may differ there.

If you only have the PDF

Ask the document owner for an editable source or a corrected version if either is available. If you need to work from the PDF itself, first check what your PDF editing software allows and whether the relevant text or background can be changed. Save a separate revised copy, inspect the affected pages, and run the contrast comparisons again. If the content cannot be edited reliably, request a clearer or accessible version rather than assuming the problem has been fixed.

For scanned pages, a better source may be needed when the visible words are too faint or uneven to assess or correct confidently. After any revision or OCR work, review both the visible text and the recognized content. Keep the final PDF, its check results, and any unresolved questions together for whoever maintains the document.

Sources

← Return to the tools