How to redact a PDF
- Drop the PDF. The first page appears below the search box.
- Type what has to go, one item per line (a name, an account number, a case reference), and tick All email addresses or All phone numbers if you need them. Press Find on every page: every match on every page gets a black box.
- Page through the document. Drag a box over anything the search cannot find, such as a signature, a photo or a stamp; click a box to remove it.
- Press Redact and save. The page searches the saved file once more and lists what it found, which should be nothing.
Why a black box is not a redaction
The text in a PDF and what you see on top of it are separate things. A black rectangle drawn over a line hides it on screen, but the letters are still in the file: select the area and copy, or open the file in another program, and they come straight back. Court filings and government reports have been “unredacted” this way by simply copying the black bars.
We made a test PDF with three common ways of blacking something out and asked an ordinary PDF text extractor (pypdf) what it could read:
| Method | Looks redacted | Text still in the file |
|---|---|---|
| Black rectangle drawn over the text (a shape tool, or a box in Word before saving as PDF) | Yes | Yes: “Account number: 11112222” |
| Black filled box comment (Square annotation) | Yes | Yes: “Passport: 33334444” |
| Highlighter set to black | Yes | Yes: “Phone: 55556666” |
| This page (boxes drawn by hand over the same three numbers) | Yes | No: none of the three numbers anywhere in the saved file |
What this page does instead
Every page that has a black box is drawn as a picture at the quality you choose (200 dpi by default), the boxes are painted into the pixels, and the page is replaced by that picture. There is no text layer on it any more, so there is nothing to copy, search or lift out from under the boxes, and no hidden layers, comments or form fields either. Pages without a box are copied as they are, so their text stays sharp and selectable and their links keep working.
Things that can give away redacted information elsewhere in a PDF are removed from the copy: the document title, author and subject (often the very name you are hiding), bookmarks, attachments, comments and form fields. Links are kept.
Then the saved file is opened again and searched, page by page, in the text and in any comments left, for every word you asked to remove and for any email address or phone number if you ticked them. The result box lists what it found.
What we tested
| Test | Result |
|---|---|
| 3-page case file: a name 5 times (two pages, one of them rotated, once in capitals, once with a double space), an email, a phone number, an account number, a comment with the name, the name in the title and author | all found and blacked out; none of them left in the saved file’s text, its raw bytes or its properties; the third page kept its text and its web link, and the comment was removed |
| Placement of the boxes, checked by drawing the saved file with a separate PDF engine (PDFium) | every redacted word 100% black; the words next to them (“Tenant:”, “born”, “Contact:”) still readable |
| File size, 2 redacted pages of text | about 35 KB per page at 150 dpi and 54 KB at 200 dpi |
Limits worth knowing
- Search finds text, not pictures of text. In a scanned PDF the words are an image, so search finds nothing; draw the boxes by hand. (If you are not sure, try selecting a word in your PDF viewer: if you cannot, it is a picture.)
- Redacted pages are images. Their text can no longer be selected or read aloud by a screen reader, and they are larger than before. Only the pages with boxes change.
- The phone number option catches long numbers of 7 to 15 digits in phone-like formats, so it may black out an account number too. Check the boxes before saving.
- Read it before you send it. Search finds exact words; a name split across two lines, a nickname or initials need their own line or a hand-drawn box.
To check what else a PDF carries before you share it, open it in Extract Text from PDF: what it shows is what anyone can copy. To remove whole pages instead, use Delete PDF Pages; to make a document look like a paper scan, Scanned-Look PDF; to lock a PDF with a password, Protect PDF. The file is redacted in your browser and never uploaded.