Skip to content

Why "redacted" PDFs still leak their text

By the CodingEagles Team 6 min read May 28, 2026 · Updated July 1, 2026 Reviewed by the Hivly studio
pdfredactionsecurity

Drawing a black rectangle over text hides nothing. The words sit underneath in a separate text layer, ready to be copied out by anyone who selects the page.

Why "redacted" PDFs still leak their text — Hivly

You black out a name. You draw a neat dark rectangle over a Social Security number, a salary figure, a witness. The PDF looks redacted, so you email it. And the text underneath is still sitting there, fully intact, waiting for the first person who drags their cursor across the page.

This is one of the most common data leaks there is. It happens because of a specific fact about how PDFs are built, and once you see it you will never trust a black box again.

TL;DR: A PDF keeps text in a separate invisible layer under the visuals. A black box is paint on top of that layer, not an eraser. The characters copy straight out and get read by search and screen readers. Real redaction deletes the text from the page and strips leftover copies, then flattens what is left.

The one fact that explains everything

Here is the mechanism. A PDF does not store a page as a flat picture. It stores the text and the visuals as separate things.

There is a text layer. Inside the file this is a content stream, a list of instructions that says “draw the letter J here, then o, then h, then n,” with the font, the size, and the exact coordinates. That layer is the real text. It is what lets you select a paragraph and copy it, what search reads when it finds a word, and what a screen reader speaks out loud to a blind user. It is machine-readable by design.

Now you draw a black rectangle over “John.” In a viewer or an image editor, that rectangle is a brand new object painted last, so it lands on top of everything. Your eyes see black. But you never touched the text layer. “John” is still down there, still spelling itself out in full coordinates, one layer below the paint.

So the box and the text coexist. The box hides the text from your eyes. It hides nothing from the file, from search, or from anyone reading the file with software instead of eyes.

The 10-second test you can run right now

You do not have to take my word for it. Open one of your own “redacted” PDFs and try this.

Click and drag to select the area under a black box, the way you would highlight a sentence. Then paste into any text editor or the search bar of your browser.

If text appears, it was never removed. The words are still in the file. If nothing comes out, and a search for the exact name or number also finds nothing, then that redaction is real. This one test is the whole article in practice, and it takes ten seconds.

I have done this on documents that were sent to me as “confidential and redacted,” and watched the supposedly hidden names drop straight into my clipboard. The visual said done. The file said otherwise.

Three ways the text gets out

You do not need a forensic lab to defeat a fake redaction. Selection is only the first way.

Select and copy. Drag across the blacked-out region and paste. The characters come out, because selection reads the text layer, not the pixels you see.

Extract or search. Any text-extraction tool, including the search box in your own reader, reads that same layer. Search for a name you think you hid and watch it light up under its own black box. Screen readers use the same path, which means a “redacted” name can be read aloud to anyone using assistive tech.

Delete the box. The rectangle is just another object. An editor can select it and remove it, and the original word sits there unchanged. The redaction was one keystroke deep.

None of this is exotic. The text was never gone. It was only out of sight.

This keeps happening to people who should know better

This is not a beginner-only mistake. Courts, law firms, and government agencies have all published documents where sensitive names and figures sat recoverable under black boxes.

The pattern is well documented. In more than one high-profile legal filing, a party covered witness names or confidential terms with overlay boxes, and reporters lifted the “hidden” text out of the published PDF within minutes of it going online. Public bodies have released contracts and reports where prices or personal details were blacked out on screen but copied out with a drag of the cursor. I am keeping this general on purpose, because the specific cases matter less than the shape they all share.

The shape is always the same. The document looks redacted, the person sees a clean black bar, and they assume the job is done. The leak stays invisible until someone goes looking, and by then the file is already public. If organizations with legal teams keep falling into this, the honest read is that the tool fooled them. A black rectangle in the wrong workflow is a trap dressed as a feature.

What true redaction actually does

Real redaction has one requirement. The sensitive content must not exist in the file anymore. Not hidden, not covered, not one layer down. Gone from the page.

There are two reliable ways to get there.

Delete the content, then flatten. Proper redaction removes the underlying text and any objects in the covered region from the content stream, then writes out a clean page. After that, selecting the area gives you nothing, because nothing is there. Search finds nothing. There is no box to delete, because the words it was hiding no longer exist. Good redaction tools also strip the same text where it may hide in the file’s metadata or in a saved earlier version, so there is no leftover copy to recover.

Cover, then rasterize. The other dependable route is to place your covering marks and then convert the page into a flat image. The page becomes pixels instead of text-plus-shapes. A rasterized page has no text layer to select and no separable box to peel off. What you see is genuinely all that is in the file. The tradeoff is that the whole page loses its real text, so it is no longer searchable or copyable anywhere, and the file gets bigger. For a single page that must never leak, that tradeoff is usually worth it.

Both routes share one principle. The hidden text is not behind something. It is destroyed.

A rule you can actually use

Here is the rule I would give anyone handling sensitive documents.

If it would be fine for the covered text to surface later, you do not really need redaction, and a visual box is your own business. If the covered text must never be recoverable, a visual box is not enough and never will be. In that case you have two acceptable outcomes: real redaction that deletes the underlying content, or cover-then-rasterize so the page carries no text layer at all. Anything that leaves the original characters in the file is not redaction. It is a costume.

And keep the habit from earlier. After you redact, test your own work before you send it. Select across the area you hid, paste it somewhere, and search for the exact name or number you meant to remove. If nothing comes out and nothing is found, the redaction held. If the text appears, you just caught a leak on your own machine, which is exactly where you want to catch it.

Doing this without uploading the document

There is a quiet wrinkle in all of this. The documents that most need redacting, contracts, medical records, identity documents, are the same ones you least want to upload to a stranger’s server just to black out a line. Sending a confidential file to an online tool to make it more confidential is its own kind of leak.

That is why redaction belongs in tools that run entirely in your browser, where the file never leaves your device. Local PDF tools for redacting, flattening, and rasterizing pages are coming soon to pdf.hivly.net, built so the work happens on your machine, with no upload and no account. The point is simple. If you are removing secrets from a file, the act of removing them should not hand the file to anyone else.

Until then, remember the one thing that matters. A black box is decoration. If the text must be gone, make it gone, and run the ten-second test to prove it.

Try the pdf toolsMerge, split, compress, protect, unlock, sign and convert PDFs to and from images.

Frequently asked questions

Does a black box over text in a PDF actually delete the text?
No. A black box is usually an annotation or a shape drawn on top of the page. The characters live in a separate text layer underneath, so they still copy, get read by search, and get read aloud by screen readers even though your eyes see only black.
How do I check if a black box in my PDF is fake?
Select the area under the black box with your cursor, then paste it into a text editor or the search bar. If any text appears, the words were never removed. They are still in the file, just hidden from view.
What does true redaction actually do?
It deletes the underlying text and objects from the page instead of covering them, and it strips leftover copies in metadata. After that the words no longer exist in the file, so there is nothing to select, copy, or recover.
Is flattening a PDF the same as redacting it?
Not on its own. Flattening or rasterizing a page turns text into pixels, which drops the selectable characters. That works only if you cover or delete the sensitive text first. Flatten a page that still has visible secrets and you have just baked them into the image.

Keep reading

Building something bigger?

Hivly is made by CodingEagles, a software studio that ships production web apps. If you have a real project, get in touch.

See what CodingEagles does →