Nyxiontech PDF Tools › Redact PDF

How to check a PDF redaction really removed the text

A redacted PDF can look perfect and still contain everything you meant to hide. The black boxes are on the screen and on paper, but the text underneath may still be in the file, where anyone who receives it can copy it out. This guide shows how to test a redacted PDF in a few minutes, with tools you already have, and how our Redact PDF tool removes the text.

Why a black box is often not a redaction

A PDF page is built from layers: the page text, drawings, images, comments (annotations), form fields and document properties. A black rectangle drawn in a word processor before exporting, a shape or comment added in a PDF app, or an annotation in a preview app is just one more object placed on top of the text. It hides the text from view, but the text is still part of the page.

That text can be selected and copied, found with search, pulled out by any converter, or revealed by moving or deleting the rectangle in an editor. White text, white-out boxes and text recoloured to black have the same problem. Information also lives outside the page content: in comments, form field values, the document properties (author, title) and the file name.

A real redaction removes the text from the file. You cannot tell the two apart by looking, so test the file.

Five checks for a redacted PDF

Always test the file you are about to send, not the original. Do every check: each one catches something the others miss.

  1. Copy and paste. Open the file, select everything on the page (Ctrl+A or Cmd+A) and paste it into a plain text editor. Then drag a selection over just the blacked-out area and paste again. If the hidden words appear, they were only covered. If everything you paste comes out as nonsense rather than just the hidden part, this check cannot tell you anything until you deal with that: see why PDF text pastes as gibberish.
  2. Search. Press Ctrl+F (Cmd+F) and search for part of each thing you removed: a surname, the last digits of an account number, a street name. Numbers are written in many ways, so try them with spaces, with dashes and without.
  3. Extract the text with pdftotext. pdftotext, part of Poppler (poppler-utils on most Linux systems, poppler in Homebrew on a Mac), prints all the text on the pages, including text hidden under boxes or drawn in white. If the commands below find nothing, that part is clean.
  4. Comments, form fields and properties. Open the comments panel and look through any form fields: copy-paste and pdftotext do not show their contents. Check the document properties in your viewer, or run pdfinfo, for the author, title and subject.
  5. The file name and the rest of the package. "contract_John_Smith.pdf" gives away what the boxes hide. Rename the file, and check any other attachments sent with it.
pdftotext redacted.pdf - | grep -i "smith"
pdftotext redacted.pdf - | grep -E "[0-9]{6,}"
pdfinfo redacted.pdf

The second command lists every run of six or more digits, which is a quick way to spot account, phone or ID numbers you forgot about.

What a pass looks like

To see the whole answer at once instead of checking one item at a time, Compare PDFs will diff the original against the redacted file and list every line of text that disappeared. A page that was redacted properly loses its entire text layer, because the page is re-rendered as an image, so a page that reports only a few removed lines is a page the redaction did not reach. How to compare two PDFs covers reading the result.

If any check fails, go back to the original, redact again with a tool that removes the content, and test the new file. Do not try to fix the leaking file by drawing more boxes on it.

How the Redact PDF tool does it

Redact PDF runs in your browser, on your device, so the file is never uploaded. This is what it does:

Limits to know about

Whichever tool you use, run the five checks on the result before you send it.

Open Redact PDF