MyOnlineTools

How to redact a PDF

Covering text is not redaction. The glyphs and image pixels under the mark have to be removed, and the saved file has to be checked afterwards.

Vane BaibyLast updated

Key facts

  • A black shape drawn over a PDF is an object on top of the page; the text underneath remains selectable, searchable and extractable.
  • This tool deletes every glyph whose box intersects the mark and erases image pixels underneath, then saves with unreferenced objects garbage-collected.
  • It re-opens its own output and counts characters still inside any box; the result is only verified when that count is zero.
  • Document metadata, XMP and embedded attachments are cleared, but comments, form fields and hyperlinks are left in place.

The most common PDF redaction mistake is also the most understandable: draw a black rectangle over the name, save, send. The document looks redacted. It usually is not.

A rectangle is a shape painted on top of the page. The text underneath is still there — a text object with a position, a font and characters. Select all, copy, and it comes back. Search for the name and it is found. Run a text extractor and the “hidden” information is plain text.

An employee record PDF with red boxes drawn over a national ID number and a salary value before redaction

Marking is only the first step. Until the file is rewritten, the numbers under these boxes are still text objects.

What real redaction has to do

A proper redaction tool changes the document, not the view. For each marked area it must:

  1. Remove every glyph whose box intersects the mark, not just the characters that happen to be visible.
  2. Erase image pixels under the mark, for scans and screenshots where the text is part of a picture.
  3. Rewrite the file without the removed content, so deleted streams do not survive as unreferenced objects.
  4. Check the saved output, not the in-memory page, for anything left inside the boxes.

The redaction tool does those four things. The black areas you see in the result are drawn after the content is gone, which is why the output cannot be reversed by removing a layer.

The redacted employee record with black blocks over the ID and salary, and a verified report saying no text remains inside the boxes

The verified result: the ID and salary are blacked out, and the report confirms that no text remains inside the marks.

How to do it

  1. Open the original, not a copy you already annotated. Redaction is destructive; work from the source of truth.
  2. Search for each sensitive term first. Find every occurrence — including headers, footers, tables, attachments and the back of the page. A name often appears more than once.
  3. Draw one box per area. Overlap is allowed. A click without dragging is ignored, so a stray click cannot redact something by accident.
  4. Run the redaction. The first run downloads a 9.9 MB PDF engine (MuPDF compiled to WebAssembly); the browser caches it, and later runs are offline.
  5. Read the report. “Verified: no text remains inside the boxes” is the only acceptable outcome. If verification fails, do not share the file — add the missing area and run again.
  6. Test the output yourself. Open it, try to select inside the black areas, and search for the removed text. It should find nothing.

The output is still a normal PDF. The unredacted text remains selectable and searchable, the page does not turn into a flat image, and the file does not grow the way a fully rasterised page would.

What gets cleaned, and what does not

Item After redaction
Text inside marked boxes Removed at glyph level, verified
Image pixels under boxes Erased; scanned pages re-encoded
Unreferenced objects Garbage-collected on save
Document metadata (title, author, dates) Cleared
XMP metadata and embedded attachments Cleared
Comments, form fields, hyperlinks Left in place

That last row is the one to remember. Comments and filled form fields can contain the same sensitive text you just removed from the page. If the document has them, delete or flatten them first, then redact. Links are kept because silently breaking a document’s navigation is its own kind of damage.

When a black box is fine

Almost never, for a digital file. A printed page is different: if you print the document and black out a line with a marker, the paper copy is genuinely opaque. The moment the result is scanned or photographed, though, the marker is just dark pixels — and if the page underneath is still readable at an angle or under strong light, it is not redacted either.

For internal drafts where the goal is “don’t read this yet”, a highlight or a comment is enough. For anything sent outside the organisation, the content has to go.

Redaction is not a substitute for policy

Removing a name from a page does not decide whether the document should be shared, how long it should be kept, or who is allowed to see the unredacted original. Those are records-management and legal questions, and they differ by jurisdiction and sector.

Two practical rules survive most policies:

  • Keep the original somewhere controlled. Redaction is irreversible by design; the unredacted source is now a separate sensitive asset with its own retention rules.
  • Redact before the file leaves your device. Sending an unredacted copy to a cloud service to “clean it up” defeats the purpose.

Privacy

The parsing and rewriting happen in a Web Worker on your device. There is no upload endpoint, no account and no queue. That matters more here than anywhere else: the file is being redacted precisely because it is sensitive.

If you also need to remove a signature or fill a field before redacting, do that first with Fill a PDF form, then treat the redaction as the final step.

Questions this guide answers

Is drawing a black box over text enough to redact it?

No. The box is painted on top; the text object is still in the file. Anyone can select it, copy it, search it, or extract it with a text tool. Real redaction removes the glyphs and image pixels themselves, then verifies the saved file.

Does redaction work on a scanned PDF?

Yes. A scan has no text layer, so the tool erases the pixels under the box and re-encodes the affected image. The rest of the page keeps its resolution; the whole scan is not flattened into a new picture.

What does the verification actually check?

After saving, the tool opens the output as a fresh document, extracts text again and counts characters whose position falls inside any marked rectangle. It also garbage-collects unreferenced objects. The result is marked verified only when no text remains inside the boxes.

Are comments, form fields and links removed?

No, deliberately. Deleting links would silently break the document. If a comment or a filled field contains sensitive text, remove it in a PDF editor first, then redact. Metadata, XMP and attachments are cleared automatically.

Sources