Sanitize PDF
Removes what a PDF carries besides its pages: metadata, JavaScript and automatic actions, attached files, hidden layers, page thumbnails and data that editing apps keep for themselves. Invisible text is removed too, except the text OCR adds to make scans searchable. Links, form fields and comments stay unless you choose to remove them. A report lists what was removed and what wasn’t found.
What Sanitize PDF does
Sanitize PDF removes what a PDF carries besides its pages: document properties such as the author and title, the XMP metadata block, attached files, JavaScript and automatic actions, layers that are turned off, page thumbnails, data that editing apps keep for themselves, and text that's on the page but not drawn. Run it before you send a file outside your organization.
The clean copy is written as a new file, so removed data isn't left behind in it. The tool then scans that file again for each kind you chose. A report lists each kind it removed, with a count, and the kinds it checked and didn't find.
How to remove hidden data from a PDF
- Drop a PDF on the box above.
- Under What to remove, keep the seven kinds selected by default or change them. Links, Form fields, and Comments and markup are off by default, because removing them changes what people see or can do with the file.
- Select Remove hidden data. Read the report, then download the clean copy.
What it removes
| Metadata | On by default. Title, author, subject, keywords, the apps that made the file and its dates, plus the XMP metadata block. |
|---|---|
| JavaScript and actions | On by default. Scripts, and actions that run when the file or a page opens or a link is clicked. |
| Attachments | On by default. Files embedded in the PDF, including ones pinned to a page. |
| Hidden layers | On by default. What's drawn on layers that are turned off. Layers that were showing stay, as plain page content. |
| Page thumbnails | On by default. Small page previews stored in the file, which can show a page as it looked before an edit. |
| Private app data | On by default. Data that editing apps store for themselves, which can include earlier versions of content. |
| Hidden text | On by default. Text that's on the page but not drawn. The invisible text OCR places over a scan to make it searchable is kept. |
| Links | Off by default. Web, email and page links. The text stays but isn't clickable. |
| Form fields | Off by default. What's in each field is drawn onto the page as plain content, then the fields are removed. |
| Comments and markup | Off by default. Notes and replies, highlights, stamps, drawings and file pins. |
| Check | The new file is scanned again for each selected kind. If any is still found, the report says so and tells you not to rely on the file. |
Limits
- Sanitizing doesn't change what's printed on the page. To remove visible text or images, use Redact PDF first.
- Hidden text means text set to invisible in a page's own content. Text colored to match the background, covered by a shape or image, or inside an embedded graphic (form XObject) isn't detected. Look over the pages before you share the file.
- The file name isn't part of the PDF's data. Rename the file if the name gives anything away.
- One file at a time. To clean many files, use Batch process with a Remove hidden data step.
- Any change to a file breaks a certificate-based digital signature in it.
Where your file goes
Sanitizing runs in this browser tab with pdf-lib. Your PDF isn't uploaded; the clean copy is made in the tab.
If you're signed in, the result panel also offers Save to My documents. Only that button uploads the file, to your account's storage.
Questions
What is hidden data in a PDF?
Information saved in the file that you don't see on the page: who made it and with which app, when it was created and changed, attached files, scripts, layers that are turned off, and data that editing apps keep for themselves, which can include earlier versions of the content.
Is sanitizing the same as redacting?
No. Redacting removes content you can see on the page. Sanitizing removes data that isn't on the page. Before sharing a sensitive file, redact first, then sanitize.
Will the pages look different afterwards?
Not with the default choices: text, images and drawings that show on the pages stay as they are. The options that are off by default do change the file: links stop being clickable, form fields become plain page content, and comments and markup are removed.
Will it remove the text layer from my scanned PDF?
No. Invisible text that sits over an image, which is how OCR makes a scan searchable, is kept. Other text that isn't drawn is removed.
How do I know it worked?
After removing, the tool scans the new file again for each selected kind. The report lists what was removed, with counts, and what was checked and not found. The second scan looks for the same things as the first, so it can't catch what the tool doesn't detect, such as text colored to match the background.
What happens to a password-protected PDF?
You're asked for the password when you add the file. The clean copy has no password, so run Protect PDF on it if it needs one.