pdfcosmos

Sanitize PDF

Strip metadata, scripts, attachments, and annotations from your PDFs in one click.

Free, fast, and privacy-first.

Sanitize your PDFs

or drag & drop files here

PDF files onlyup to 30 filesup to 100 MB each300 MB total

Sanitize a PDF — strip hidden data before you share it

A PDF can quietly carry far more than the pages you see: your name and software in the metadata, scripts that run when it opens, other files embedded inside, and comments or form data. Sanitize PDF is the all-in-one cleanup: with four checkboxes you choose what to strip — metadata, embedded JavaScript, attachments, and annotations (including form fields) — and all four are on by default. Each is genuinely deleted from the file, the underlying objects and bytes removed rather than just hidden, so nothing lingers to be recovered.

Your visible pages, text, and images are left exactly as they are — only the hidden layers you tick are removed (note that clearing annotations also drops interactive form fields and comments, and removing JavaScript stops any script-driven form behaviour). Clean one PDF or up to 30 at once, downloading a single file or a ZIP. It all runs in your browser with pdf-lib, so your files never leave your device. Sanitize is the umbrella over our focused tools — Remove Metadata, Remove JavaScript, Remove Attachments, and Remove Annotations — so reach for one of those when you only need a single job.

  • Four cleanups, one pass

    Strip metadata, JavaScript, attachments, and annotations together — or just the ones you tick.

  • Truly deleted, not hidden

    The underlying objects and bytes are removed, so nothing lingers to be recovered.

  • Visible pages untouched

    Your text and images stay exactly as they are; only the hidden layers go.

  • Clean up to 30 at once

    Sanitize many PDFs before sharing; they download together as a ZIP.

How to sanitize a PDF

  1. Add your PDF(s)

    Drop one file (or up to 30) into the upload area.

  2. Choose what to remove

    Tick the data you want stripped. Metadata, JavaScript, attachments, and annotations are all selected by default.

  3. Sanitize and download

    Click “Sanitize PDF” and download your cleaned file (a ZIP for several). Everything happens in your browser.

Frequently asked questions

Are my PDF files uploaded to a server?
No. Sanitizing happens entirely in your browser using pdf-lib. Your files never leave your device. You can confirm it in your browser's Network tab: no file data is sent.
What does “sanitize” remove?
Whatever you tick: hidden metadata (author, software, dates, XMP), embedded JavaScript (document, open-action, trigger, and form scripts), attachments (embedded and portfolio files), and annotations (comments, highlights, stamps, links, and form fields). Each is deleted from the file, not just hidden.
Why sanitize a PDF before sharing it?
A PDF can quietly carry more than the visible pages: your name and software in the metadata, scripts that run when it opens, other files embedded inside, and comments or form data. Sanitizing strips those so you only share the document itself.
Will it change how the pages look?
No. Only the selected hidden layers are removed. Your pages, text, and images are untouched. Removing annotations does drop interactive form fields and comments. Removing JavaScript stops any script-driven form behaviour.
How is this different from the focused Remove tools?
Sanitize PDF is the all-in-one: it does the same work as Remove Metadata, Remove JavaScript, Remove Attachments, and Remove Annotations in a single pass, and lets you pick which ones. Use a focused tool when you only need one of them.
Can I sanitize several PDFs at once?
Yes. Add up to 30 PDFs. One file downloads as a cleaned PDF (with its original name), and two or more download together as a single ZIP.