ZERO-TRUST PDF

How to properly redact a PDF

Redacting a PDF properly means one thing. When you are finished, the words are not in the file. Not covered, not hidden behind something, not invisible until somebody looks harder — absent. Most of what gets called redaction fails that test, and the failure is silent, which is the whole problem. The document looks exactly the way you wanted it to look.

The good news is that you do not have to take anyone's word for it, including ours. A redaction is one of the few things in software you can check yourself, in seconds, with no tools at all.

The five-second test

Open the file you are worried about. Select the whole page, copy it, and paste it into any text box you like — an email draft, a search bar, a notes app. Or press Ctrl+F and search for the thing you thought you removed. If it turns up, it was never removed. It is sitting in the file, under the black box, one keystroke from anyone who receives the document.

Here is that failure on a document made for this page. One page, a placeholder name, a placeholder case officer and a Social Security number taken from the block the SSA reserves for advertising, so it cannot belong to anyone. An opaque black rectangle is drawn over the number the way any viewer's markup tool would draw it. On screen the number is gone. Asking the file for its text returns this:

CONFIDENTIAL - INTERNAL REVIEW Applicant: Jane Q. Public SSN: 987-65-4320 Case officer: R. Example

Nothing clever happened there. A PDF page is a list of drawing instructions, and those instructions run in order. The text was drawn, then the rectangle was drawn on top of it. Covering something later in the list does not remove it from the list. Every piece of software that reads text out of a PDF ignores what is painted over that text, because painting is not what it is reading.

This is also the honest answer to a question people search for constantly: how to black out text in a PDF without redacting it. You can, easily, in any viewer. Just know that you have hidden it and not removed it.

Deleting the page is not enough either

The next thing people try is deleting the offending page, or having a tool do it for them. That is closer, and still not sufficient, for a reason that has to do with how PDFs are built.

A PDF is a pile of numbered objects and a table saying where each one lives. A page is an object that points at other objects: its content stream, its fonts, the images placed on it. Removing a page from the document's page list removes the pointer. The objects it pointed at are still in the file, exactly as they were, unless whatever wrote the file went looking for orphans and dropped them. Plenty of libraries do not. Anything that walks the objects rather than the pages still finds every one of them.

We shipped exactly this bug

An earlier version of this tool got it wrong, and the way it got it wrong is worth describing, because it is the failure mode this whole page is about.

That version worked in place. It rendered the page you had marked to an image, removed the page from the document and inserted the new one where it had been. It looked correct. Opening the export showed the black boxes burned in and nothing selectable where the text had been. What it actually did was unhook the original page while leaving its content stream and its image XObjects sitting in the file, referenced by nothing, fully intact. The redacted words came back out of that orphaned stream.

On a scanned document it was worse. An outline entry — a bookmark in the sidebar — still pointed at the page that had been removed. That single reference was enough to keep the entire unredacted scan image alive, and it came out of the export byte-for-byte identical to the one in the original file. The redaction had, in effect, changed nothing except what the page looked like.

The part that should worry you is how long it survived. The check being run was text extraction, and text extraction reads the document's pages. Orphaned objects are not in any page, so extraction never saw them. It reported the file clean three separate times. Three passes of a test that could not fail, on a document that was still carrying everything it was supposed to have lost.

What changed is that the export is now a rebuild rather than an edit. A fresh, empty document is created. The pages you did not mark are copied into it. For each page you did mark, a new blank page is added carrying only the flattened image. Nothing belonging to a marked page is copied across, so there is nothing left in the output to orphan. The rebuild costs the document its outline, its tagged structure tree and its named destinations, because those do not survive a page copy. Given that an outline entry is what kept a full unredacted scan alive, losing it is not something we are sorry about.

The test changed too. The gate is now an object-level one, and it runs before anything ships.

What actually removes it

Rasterizing the page is what removes the text, and rebuilding the document is what stops the original coming along for the ride. Both halves are necessary. Either one on its own is the failure above.

That comes at a price, and any tool that does not tell you the price is not being straight with you. Rasterizing a page removes the text layer for the whole page, not just the part you covered. Every other word on that page stops being selectable, searchable and copyable, a screen reader can no longer read any of it, and the file gets bigger. Pages you did not mark are untouched and keep their text exactly as it was. It is a per-page trade, and it is worth understanding before you mark a page you did not need to.

The redaction tool on this site works that way, in your browser, with the file never leaving your device. Any tool that does the same two things is fine by us. The point is the two things, not the tool.

How to check a redacted PDF, including ours

There are three levels of checking, and they are not equally strong. It is worth knowing which one you are relying on.

The first is select-all and copy, or a search in your reader. It takes five seconds and it catches the black-rectangle case, which is most cases. If a document fails this, stop and start again; there is nothing else to investigate.

The second is text extraction, which is what most verification features do and what ours does. It is better than a manual search and it is still not the last word, for the reason above: it reads the document's pages, and the failure worth catching lived outside them. There is a second trap specific to redacted files. Once a page has been rasterized it has no text at all, so extraction comes back empty no matter what is printed on the image. Empty is not the same as clean, and any verifier that presents it as clean is overstating its evidence.

The third is the object level, and it is the one that actually answers the question. Instead of asking what the pages say, you ask whether the string exists anywhere among the file's objects at all. One warning if you try this yourself: do not scan the raw bytes. Streams inside a PDF are compressed, so a search through the file as it sits on disk misses text that is plainly in there, and it can also match on compressed noise that means nothing. The file has to be parsed and its streams decoded before the search means anything.

Run that on the demonstration document and the covered file gives up the number immediately, in the decoded content stream of a single object. Put the same file through this tool with a box over that line and export, and the result is 30,037 bytes across nine searchable objects, with no occurrence of the number in any of them. Not hidden in a stream, not sitting in an orphan, not present.

After every export here, the Verify panel reads the file you just downloaded back off your device and lets you search what it can extract. It will also tell you, in as many words, when a page has no text layer for it to search — which is the honest limit of what extraction can prove, and the reason the object-level check exists behind it.

If you are trying to un-redact something

People search for this, and the query is the best evidence there is that the failure is common. The answer is that it depends entirely on how the redaction was made, and you already know how to find out: copy the page and see what you get.

If the text was covered, it is still there and it never required a tool to retrieve. If the page was rasterized and the document rebuilt, the words are not in the file and nothing will bring them back, because there is nothing left to bring. What you will not find here is a procedure for pulling content out of a document that is not yours. If it is your own file and you need to know whether the redaction held, that is the verification section above, and it is the same question asked the useful way round.

Common questions

How do I properly redact a PDF?
Removal, not covering. The page carrying the sensitive text has to be turned into an image so the text layer on it stops existing, and the exported document has to be built fresh so the original page is not carried across. Drawing a black box, using a highlighter set to black, or deleting the visible text in an editor all leave something behind. Once you have a file, check it rather than trusting it: search the exported document for the exact string you removed.
How do I un-redact a PDF?
It depends entirely on how the redaction was done, and you can tell which case you are in within seconds. If the text was only covered with a rectangle, it was never removed: selecting the page and copying it returns the words that look hidden. If the page was rasterized and the document rebuilt without the original, the text is not in the file at all and no tool will recover it, because there is nothing left to recover. This page will not walk you through extracting content from a document that is not yours.
How do I remove blackout text in a PDF?
If you mean the black bars are in your way and you need to read your own document, the answer is the same as above: the text is either still sitting under the rectangle, in which case copying the page returns it, or the page is an image and the words are gone for good. If you mean you want to take the black bars off a document you are producing, work from the original file rather than the redacted export. A properly redacted export is meant to be a one-way trip.
How do I black out text in a PDF without redacting it?
Any viewer with markup tools will do it: draw a filled rectangle over the words and save. Be clear about what you get, though. The text stays in the file underneath the rectangle and copies straight out, so this is only appropriate when hiding is genuinely all you need — a screenshot for a slide, a mockup, something nobody will receive as a file. For anything sensitive going to anybody else, covering is not enough.