How to redact a PDF (really remove the text)
Most "redaction" just draws a black rectangle over the words. The text is still in the file, so anyone can copy it, search it, or move the box aside. Real redaction takes the words out of the PDF. Here is how to do it properly.
Why a black box is not redaction
Drawing a filled box over text only hides it visually. The characters are still
in the content stream underneath. Select the area and copy, run pdftotext,
or open the file in another viewer and the "redacted" text is right there. Plenty of
real leaks have happened exactly this way, in big companies and actual governments.
The color of the overlay changes nothing: black highlighter, white boxes, and blur effects that are just an overlay all leave every word in the file. If it was drawn on top, nothing was removed.
The right way: delete the text, then mark it
Proper redaction removes the words from the PDF itself, so search and copy return nothing. A bar is drawn on top afterward only as a visible mark, over a spot that is already empty. pdfblah does both: it deletes the matched text from the content stream and draws the bar, so the bar never hides text that is still there.
Step by step
- Open pdfblah.com and drop in your PDF. It runs a quick check and shows what is inside.
- + Add step → Redact. Type the text to remove.
- Pick the scope. Redact the first match, every match, or the Nth. You can ignore case, match whole words, or use a regular expression.
- Preview for free. You see a bar over each spot, and the change is highlighted, before you download anything.
- Download. The words are gone from the file. Verify with copy,
Ctrl+F, or
pdftotext.
Test it after, every time
Whatever tool you used, verify the output before it leaves your hands:
- Try to select text over the bars. If anything highlights, the words are still there.
- Search for a redacted word with Ctrl+F / Cmd+F. It must find nothing.
- Dump the whole text layer and look:
pdfblah extract out.pdf --text -o check.txt(orpdftotext), then search the text file. pdfblah's report also lists exactly what was removed and where.
And clear the metadata while you're there
Author names, company, software, and edit history sit in the file's properties,
outside the page text, and survive page-level redaction. Strip them in the same pass:
add a Metadata step in the workbench, or on the command line
pdfblah meta out.pdf final.pdf --strip. The
metadata guide shows what your PDF is quietly
carrying.
Redact a lot of things at once
To remove every email, card number, IBAN, SSN, or phone number in one click, use the Scrub PII preset instead of typing each one.
Three ways to run this
Same engine, same result. Pick one:
- Online at pdfblah.com, nothing to install and free while we're testing.
- Local app, the same tool on your own machine in your browser, free and private (your PDF never leaves your computer):
pipx install pdfblahthenpdfblah gui. - Command line, for scripts and bulk jobs:
pipx install pdfblah
pdfblah redact in.pdf out.pdf --find "Account 12345"
pdfblah redact in.pdf out.pdf --find "\d{3}-\d{2}-\d{4}" --regex # every SSN
The local app and CLI are open source and free. See the pdfblah project on GitHub or the guide to running it locally.