RoRoTo
On-device

How to redact a PDF so the text is actually gone

Drawing a black box over text hides it from your eyes and from nobody else. The characters are still in the file.

There are two operations that both look like redaction on screen, and only one of them is redaction.

The first draws a filled rectangle over the text. It is a reveal trick. The characters, their positions and their encoding are untouched underneath; the rectangle is simply painted later in the display order. Select all, copy, paste into a plain-text editor, and the "redacted" sentence appears in full.

The second removes the text itself and then draws the box. What remains is a page with a hole in it — no characters, nothing to copy, nothing to recover.

This is not a hypothetical failure

In January 2019, a filing in a US federal court was published with passages blacked out. The blacking out had been done the first way. Anyone who selected the text and pasted it elsewhere could read the sealed passages, and reporters did so within hours. The material was about a defendant's contacts and business dealings; it became public because a rectangle was mistaken for a redaction.

The same mistake recurs in exactly the documents where it hurts most — settlement agreements, medical records, HR files, court exhibits — because the tool used to make them (a PDF editor's "draw" tool) is the most obvious thing in reach.

What "really gone" requires

A PDF page is a content stream: a sequence of drawing operators. Text appears as instructions like "begin text, set font, position at this coordinate, show these glyphs, end text". A rectangle is a different operator painting a filled path.

Proper redaction has to operate on the first kind of operator. The steps, in order:

  1. Locate every text object that intersects the marked area — not just visually overlaps, but any glyph whose bounding box touches it.
  2. Remove those objects from the content stream and rewrite the stream without them.
  3. Remove the corresponding entries from any structure tree — tagged PDFs keep a parallel logical structure, and it can retain the removed strings.
  4. Strip annotations and form fields in the area; a text field's value is not in the content stream at all.
  5. Clean document metadata — author, creating application, and XMP history can name the person or the matter.
  6. Now draw the box, purely as a visual marker.

Skip step 1 and keep the box, and you have produced the 2019 filing.

Scanned documents are the harder case

If the page is a scan, the sensitive content is pixels, not characters. Covering it with a rectangle is only safe if the drawing operation genuinely replaces those pixels rather than layering over them — and "flattening" a PDF does not always do what the word suggests.

There is a second trap: scans that were OCR'd carry an invisible text layer. You can paint over the visible image and leave a perfectly readable copy of the sentence in the text layer underneath. If a document has been through any OCR at any point, assume there is text under the picture.

The safe order for scans is: redact the image region so the pixels are destroyed, then verify that no text layer exists in that area, then re-OCR if searchability is needed after redaction — not before.

How to verify your own output

Never ship a redacted file you have not attacked. Three checks, all of them seconds:

  • Select all and copy the whole document into a plain text editor. Search for the redacted name or number. If it is there, the redaction was a rectangle.
  • Search inside the PDF — Ctrl+F for the sensitive term. Search reads the text layer, so a hit means the text survived.
  • Convert it back to text using Extract text and read the output. This is the same view an automated data harvester would get, which makes it the honest test.

There is a fourth check worth doing when the stakes are high: compare the redacted file against the original page by page, and look for pages where the box appears but the file size barely changed. A page that lost 30 characters will not compress much differently, but a page that lost a 200-word paragraph usually will.

Why the file should never be uploaded

The documents people redact are, by definition, the ones that must not be disclosed: contracts with counterparty names, medical records, identification documents, sealed filings, internal HR correspondence. Uploading one to a web service to have a rectangle drawn over a line of text is a disclosure event in itself — and it happens before any redaction exists.

Redaction is a local operation. It reads a file you have, removes objects, and writes a file back. There is nothing about it that requires a server, and no legitimate reason for a redaction tool to need one.

Doing it in the browser

  1. Open Redact and drop in the PDF. The file is loaded into the tab and parsed there.
  2. Draw over the areas to remove. Each box marks a region whose text objects will be deleted, not covered.
  3. Apply the redaction. The text is removed from the content stream and the marked areas are filled.
  4. Download the result and run the three checks above — especially the copy-and-paste one. Do not skip this because the tool says it worked.

Two honest limits: this is not a substitute for a legal-grade redaction workflow on evidence that will be filed in court, and it does not audit the rest of the document — text in a comment, an attachment, or an embedded file is outside the page area you can see. If the document has attachments, inspect those separately.

A short checklist before sending

  • Redacted by deleting, not by covering — verified with select-all-copy.
  • Text layer checked on any scanned page that was ever OCR'd.
  • Annotations, form fields and comments cleared.
  • Document metadata and XMP history cleaned.
  • Embedded attachments listed and removed if not needed.
  • Page count and file size compared against the original for anything unexplained.

Frequently asked

Is drawing a black box over the text enough?

No. A rectangle is painted over the page; the characters underneath are untouched and can be copied out with select-all. The text has to be removed from the content stream, and the box drawn afterwards as a marker.

Can the redacted text be recovered from the new file?

Not if it was removed properly — there is nothing left to recover. If you can still find the term with Ctrl+F or by pasting the page into a text editor, the redaction failed and the file must not be sent.

Does the PDF get uploaded to a server?

No. The file is parsed and rewritten inside the browser tab. That matters here more than elsewhere: the documents people redact are the ones that must not be disclosed to anyone, including a conversion service.

What about a scanned PDF where the text is part of the image?

The pixels have to be destroyed, not covered, and any OCR text layer under the image has to be removed as well. A scan that was ever OCRd can carry a readable copy of the sentence beneath the picture.

Tools mentioned

Published 2026-11-14 · All guides