Sanitize PDF
Remove JavaScript, attachments, links and metadata from a PDF, and optionally comments, in your browser. See what stays in the file before you share it.
Upload PDF File
About This Tool
Sanitize PDF unlinks hidden or active content from a PDF: JavaScript, embedded attachments, links, document metadata and, if you choose, comments, and it flattens form fields. Readers no longer show the removed items, but removed objects such as attachments and XMP metadata stay in the raw bytes of the saved file, so confidential material needs one more step.
Six options are offered, and the first five start ticked:
- Remove JavaScript: deletes document-level scripts and the actions set to run when the file opens or a page is opened or closed. Scripts on individual buttons and other annotations are not searched for separately.
- Remove Attachments: removes the document's list of embedded files. Files attached to a comment stay unless you also remove annotations.
- Remove External Links: despite the label, deletes every link, including links that jump to another page of the same document.
- Flatten forms: draws the form fields and their current values into the page and removes the fillable fields.
- Remove Metadata: clears the document properties, such as title, author, keywords and dates, unlinks the XMP metadata and sets the producer to Priya LifePDF.
- Remove Annotations, off by default: deletes every comment, highlight, stamp and other annotation on every page.
The "Removed:" line lists each step that ran, not what was found, so it can name JavaScript, embedded files or links that the file never had. To clear the unlinked objects from the bytes, run the result through Linearize PDF, which rewrites the file without objects that nothing refers to, or turn the pages into images with Rasterize PDF. Layers, bookmarks and text under drawn boxes are not touched; see how to redact a PDF properly and how to remove metadata from a PDF.
Saving rewrites the whole file, so a digital signature in it will no longer verify. Unlock encrypted files with Decrypt PDF first. Everything runs in your browser; the PDF is not sent anywhere.
How to Use
Add a PDF
Drop one PDF on the upload area or click to browse.
Choose what goes
Under Sanitization Options, untick anything you want to keep, such as links in a document with a clickable contents page. Tick Remove Annotations if comments must go too.
Run it
Click Sanitize PDF and wait for the progress bar to finish.
Download and finish off
Save the _sanitized.pdf file. For confidential content, run it through Linearize PDF as well, then open it and check that what remains behaves as you expect.
Use Cases
Prepare a file for a public portal
Strip scripts, attachments and authoring details from a report before it is uploaded to a website or submission system.
Calm down a file from outside
Remove document scripts and open actions from a PDF you did not create before it is passed round the team.
Send a filled form as a fixed record
Flatten the answers into the page so the recipient sees the values but cannot change the fields.
Frequently Asked Questions
Is the removed data gone from the file?
Not entirely. Removed attachments, XMP metadata and comments are unlinked, so readers no longer show them, but their objects remain in the saved bytes, where a tool that reads raw PDF data can find them. Run the result through Linearize PDF, which writes out only the objects still in use, or Rasterize PDF if nothing but the page appearance should survive.
Why were links inside the document removed too?
The Remove External Links option deletes every link annotation, whether it points to a website or to another page in the same document. Untick it if the contents page or cross-references must keep working.
Why does the Removed list name things my file did not have?
The list records each removal step that ran, not what was found. JavaScript, embedded files and links are listed whenever their option is ticked; form fields are listed only when the file had some.
Does it remove comments?
Only if you tick Remove Annotations, which is off by default. When ticked, it deletes every annotation on every page, links and form widgets included, not only comments.
Does it remove hidden layers or text under black boxes?
No. Optional content layers, bookmarks and the page text are left as they are. Text covered by a drawn box is still in the file; rasterising the pages is the way to get rid of it.
Will it affect a digital signature?
Yes. The whole file is rewritten when it is saved, so an existing signature will no longer verify. Sanitize a copy before it is signed, not afterwards.
