DEV Community

Cover image for ⬛ Redact PDF: Actually **delete** the text — not just draw a black box over it
Tomaz
Tomaz

Posted on Originally published at tooladda.online

⬛ Redact PDF: Actually **delete** the text — not just draw a black box over it

⚡ 10-second version

Black out names, addresses, account numbers and IDs at tooladda.online/redact-pdf.html — and have the underlying text removed from the file, not merely hidden behind a rectangle.

❗ Important

You are redacting because the content is sensitive. Uploading it to a redaction service first is self-defeating. Everything here happens in your browser.


🚨 The mistake that has leaked real documents

This is the most consequential misunderstanding in this entire toolkit, and it keeps happening at organisations with legal departments.

Drawing a black rectangle over text does not remove the text.

A PDF is layers. Add a black box and you've added a drawing on top. The characters are still sitting underneath, fully intact:

What you see:        ████████████  ← black rectangle (a drawn object)
What's in the file:  "Rahul Sharma" ← the text, untouched, one layer down
Enter fullscreen mode Exit fullscreen mode

Anyone can recover it in seconds — no tools, no skill:

Method What happens
Ctrl+A, Ctrl+C, paste into Notepad The "redacted" text appears in full
Any PDF text extractor Returns the hidden content
Move or delete the rectangle in an editor Text revealed
Search the document for the name It's found, under the box

This has caused genuine, public exposures of witness names, salaries, medical details and unredacted contract terms — documents that were reviewed, signed off, and published by people who believed they had redacted them.

Real redaction deletes the text objects and then draws the box. After that, Ctrl+A returns nothing, because there is nothing. That's what this tool does.

How to verify any redaction — 10 seconds, always do it

1.  Open the redacted PDF
2.  Ctrl+A  (select all)
3.  Ctrl+C  (copy)
4.  Paste into a plain text editor
5.  Search for what you redacted
Enter fullscreen mode Exit fullscreen mode

If you find it, the redaction failed. Do this on every document before it leaves your hands.


🧭 How it works

Diagram

Note the order: delete, then cover. A tool that draws first and never deletes is not a redaction tool.


✨ What's inside

### 🗑️ True text removal Text objects are deleted from the content stream before the box is drawn. `Ctrl+A` on the output returns nothing. ### 🔍 Search-and-redact Type a name or an account number and redact **every** occurrence across every page. Manual clicking is how page 14 gets missed.
### 📸 OCR mode for scans A scanned PDF has no text layer, so there's nothing to delete — but the words are visible in the image. OCR locates them so the image region itself can be blacked out. ### 🔒 Nothing leaves the tab The document you least want to upload, never uploaded.

🛠️ Real jobs

Situation What to redact
⚖️ Filing a document with a court Third-party names, addresses, account numbers
📄 Sharing a contract as a template Client name, pricing, commercial terms
🏥 Medical records for a claim Other patients' details, diagnoses you needn't disclose
🏦 Bank statement for a loan Unrelated transactions, other account numbers
🗂️ GDPR / RTI response Personal data of anyone other than the requester
📰 Publishing a source document Identities, phone numbers, signatures

📖 Five steps

1.  Open   →  tooladda.online/redact-pdf.html
2.  Drop   →  your PDF
3.  Search →  each name / number — catches every page, not just the one you're on
4.  Review →  every page visually as well
5.  VERIFY →  download, Ctrl+A, Ctrl+C, paste, search. Then send.
Enter fullscreen mode Exit fullscreen mode

▶ Redact now — tooladda.online/redact-pdf.html

⚠️ Warning

Redaction is irreversible — that's the point. Work on a copy and keep the original somewhere safe, because there is no way to recover redacted content from the output file.

💡 Tip

Don't forget the parts of a PDF that aren't the visible page: document metadata (author, title), bookmarks, comments and form field values can all carry names you thought you'd removed. Check those too, and consider flattening the file afterwards.


❓ FAQ

Is it free?

Free, no signup, no watermark.

Is a black rectangle enough?

No — and this is the single most important thing on this page. The text remains under the box and is trivially recoverable by copy-paste. Real redaction deletes the text first.

How do I know my redaction actually worked?

Open the output, Ctrl+A, Ctrl+C, paste into a text editor, and search for what you removed. If it's not there, you're fine. Do this every time.

Can redacted content be recovered from the output?

No. The text objects are gone from the file. That's also why you must keep the original.

What about scanned PDFs?

There's no text layer to delete, so the pixels must be covered — use OCR mode to find the words, then black out the image region.

Is my document uploaded?

No. Redaction runs entirely in your browser.

Should I also strip metadata?

Yes. Author, title, comments and form values sit outside the visible page and frequently contain names. Check them, and flatten the file if it has form fields or annotations.


🔬 Under the hood

  • Text objects are removed from the PDF content stream client-side, then an opaque rectangle is drawn — in that order.
  • Search mode scans the text layer across all pages; OCR mode locates words in raster pages so the image region can be covered.
  • No upload endpoint exists; works offline once loaded.

Originally published on ToolAdda, where Redact PDF runs free in your browser — nothing is uploaded, nothing leaves your device.

Top comments (0)