Sanitize PDF
Strip a PDF’s metadata, embedded files, JavaScript name tree and document-level actions before you share it.
A PDF carries more than its pages. The info dictionary holds the title, author, subject, keywords, the creating and producing applications and the creation and modification dates — often naming the author’s employer software, machine-era habits and editing timeline. Beyond that, a document can carry an XMP metadata stream, a JavaScript name tree (scripts registered to run by name), an embedded-files list (attachments bundled inside the PDF) and document-level actions that fire on open. This tool deletes a fixed, published list: Title, Author, Subject, Keywords, Creator, Producer, CreationDate, ModDate and Trapped from the info dictionary; OpenAction, AA, Metadata and AF from the document catalog; and the JavaScript and EmbeddedFiles name trees. It loads the file with pdf-lib’s updateMetadata option off, so the library does not stamp its own producer string and a fresh modification date into your cleaned copy on the way through — the detail that quietly defeats most naive “metadata removers”.
Scope, stated plainly: this cleans the document info dictionary, the document-level action entries, the XMP metadata stream and the JavaScript / embedded-files name trees. It does not touch page content, links, form fields or annotations inside pages, and it does not remove a password — pdf-lib cannot open encrypted files at all, so a protected PDF will simply fail to load here.
Quick answers
How do I remove metadata from a PDF before sharing it?
Delete the info-dictionary keys (Title, Author, Subject, Keywords, Creator, Producer, CreationDate, ModDate, Trapped), the XMP stream and the document-level extras. Here that fixed list is removed locally with pdf-lib, and the report names which items were actually present in your file.
Load with metadata updates off — otherwise the library re-stamps its own producer and a fresh modification date into the copy you just cleaned.
What else should be stripped from a PDF besides metadata?
The document-level extras most people never see: the JavaScript name tree, the embedded-files (attachments) list, and the OpenAction / additional-actions entries that make a reader do something on open.
Page-level content — links, annotations, form fields and their own actions — is a deeper clean than this tool claims; its scope is printed on the page and in its report.
How to use
- Choose the PDF — its current title and author metadata are shown, so you can see what is about to go.
- Read the removal list on the page: it names every key and name tree this tool deletes, before anything happens.
- Click “Sanitize & download”: the file is loaded with metadata updates off, the listed items are deleted, and a cleaned copy is saved.
- Check the status line: it reports exactly which items were actually present and removed from your file — and opens the cleaned copy to confirm the metadata is empty.
About this tool
The scope is stated as carefully as the list. Sanitizing here means the document-level items above: page content, text, images, links, annotations and form fields inside pages are not altered, so a script attached to a single button inside a page is outside this tool’s reach, and the status report never claims otherwise. If none of the listed items are present, the tool says so and the download is an honest clean re-save rather than a pretend scrub. Encrypted files are out of reach entirely — pdf-lib cannot open them, with or without a password — and this site offers no password-removal tool, by design. What you get is the everyday pre-sharing clean: a contract, CV or report that no longer announces who wrote it, in what, or when, and carries no bundled attachments or document-level scripts into the recipient’s reader.
Frequently asked questions
What metadata does a PDF normally contain?
The info dictionary typically holds Title, Author, Subject and Keywords, the Creator (the app that made the source document) and Producer (the app that wrote the PDF), plus CreationDate and ModDate. Many files also carry an XMP metadata stream repeating and extending the same facts. This tool deletes all of those keys and the XMP stream, and reports which were actually present.
Does sanitizing remove JavaScript and attachments from a PDF?
At the document level, yes: the JavaScript name tree (named scripts registered for the document) and the embedded-files name tree (the attachment list) are deleted, along with the catalog’s associated-files entry and document open/additional actions. Scripts wired to individual page objects, such as a single form button’s action, are page-level content and are not touched — the page states that scope rather than implying a full script purge.
Will the cleaned file still show a producer or a new date?
No — and that is a deliberate construction detail. pdf-lib normally stamps Producer “pdf-lib” and a fresh ModDate when it loads a document. This tool loads with updateMetadata switched off and deletes the date keys, so the saved copy does not quietly grow a new producer credit and modification date of its own.
Can this tool sanitize a password-protected PDF?
No. pdf-lib cannot open encrypted PDFs at all, so a protected file fails at load and the tool tells you. Removing protection is a separate operation this site deliberately does not offer: pdf-lib has no decryption support, and there is no licence-clean pure-front-end substitute.
First time embedding? Read the step-by-step guide →
More free tools
Base64 Encode / Decode
Encode text to Base64 or decode it back.
Color Converter (HEX ↔ RGB)
Convert HEX to RGB and back, with live preview.
Unit Converter
Convert length, weight and temperature instantly.
Currency Converter
Daily ECB reference rates for 26 currencies — updated once per business day.
World Clock & Time Converter
Current time in major cities, plus converter.
Meeting Time Planner
Find overlap hours across time zones.