# Sanitize PDF - Remove JavaScript, Links & Hidden Metadata

> Free PDF sanitizer: find and remove JavaScript, auto-run and launch actions, links, attachments, comments, forms and metadata, with a before/after report.

- URL: https://qilingtools.com/en/pdf/sanitize
- Category: PDF Tools (https://qilingtools.com/en/pdf)
- Tags: [PDF](https://qilingtools.com/en/tags/pdf), [Privacy & Security](https://qilingtools.com/en/tags/privacy)
- Last updated: 2026-10-26
- Price: Free, no sign-up
- Privacy: Runs locally in the browser; files are never uploaded

A PDF from an unknown source may carry JavaScript, actions that run as soon as it opens, commands that launch external programs or links that quietly call home; and a PDF you are about to send may reveal author names, company names, editing software, revision history, comments and attachments. After you upload a file, this tool scans it and lists JavaScript (with the code viewable), auto actions (document open and close, page, mouse and form events), launch actions, form submission, data import and other risky actions, multimedia and 3D active content, XFA forms, external links (with their addresses), comments, form fields, attachments, Info and XMP metadata, page thumbnails and private data written by Illustrator or Photoshop. Tick what you want removed: scripts and auto actions, attachments, metadata and private data are selected by default, while links, comments and forms are up to you. The file is rewritten from scratch, so earlier revisions left by incremental saves and unreferenced orphan objects disappear too, and the output is scanned again to show a before-and-after comparison. The text, images and layout of the pages stay unchanged. Everything runs locally in your browser, so suspicious files never leave your computer.

## How to use

1. Upload the PDF to check; it is scanned automatically for scripts, actions, links, attachments and metadata
2. Tick what to remove: scripts and auto actions, external links, comments, form fields, attachments, metadata and private data
3. Click Sanitize & download, review the before/after report and save the clean PDF

## Features

- Detects JavaScript and shows the script code
- Removes run-on-open, page and form event actions
- Removes launch, submit-form, remote-file and other risky actions
- Optionally removes links, comments, forms and attachments
- Strips Info and XMP metadata
- Removes thumbnails, PieceInfo and other private data
- Rewrites the file, dropping old revisions and orphans
- Before/after report, processed locally

## FAQ

### Why is JavaScript in a PDF a risk?

The PDF format lets documents run JavaScript when they open, when pages change or when forms are clicked or filled, and lets them launch programs or submit data to web addresses. These features are used for tracking, phishing and exploiting reader bugs. After sanitizing, the document contains no scripts or auto actions, only static content.

### Does sanitizing change what the pages look like?

No. Only the scripts, actions, links, comments, form fields, attachments and metadata you select are removed. Text, images, vector graphics and layout stay the same, and text remains selectable and searchable.

### Why is the digital signature invalid after cleaning?

Any change to a signed PDF breaks its signature; that is how signatures detect tampering. The tool warns you when it finds signature fields, so don’t sanitize files whose signatures must stay valid.

### Are my files uploaded?

No. Scanning and cleaning both happen in your browser with no network upload, so suspicious files never leave your computer.

## Related tools

- [Merge PDF](https://qilingtools.com/en/pdf/merge): Free online PDF merger: combine several PDF files into one in the order you choose, with reordering. Processed locally in your browser, no upload, no sign-up.
- [Split / Extract PDF](https://qilingtools.com/en/pdf/split): Free online PDF splitter: extract a page range into a new PDF, or split every page into its own file and download them as a ZIP. Processed locally.
- [Rotate PDF](https://qilingtools.com/en/pdf/rotate): Free online PDF rotator: rotate all or selected pages by 90°, 180° or 270° to fix scanned documents. Processed locally, no upload.
- [PDF to Image](https://qilingtools.com/en/pdf/to-image): Free online PDF to image converter: render every page as a high-resolution JPG or PNG at 72/150/300 DPI, download all as a ZIP. Processed locally, no upload.
- [Image to PDF](https://qilingtools.com/en/pdf/from-image): Free online image to PDF converter: combine JPG, PNG and WebP images into one PDF in order, with A4 or image-sized pages. Processed locally, no upload.
- [Compress PDF](https://qilingtools.com/en/pdf/compress): Free online PDF compressor: re-render pages with compressed images to shrink scanned and image-heavy PDFs, with adjustable quality. Processed locally.
- [Watermark PDF](https://qilingtools.com/en/pdf/watermark): Free online PDF watermark tool: add text watermarks to every page, tiled or centred, with opacity and angle controls. Any language, processed locally.
- [Delete PDF Pages](https://qilingtools.com/en/pdf/delete): Free online tool to delete PDF pages: remove pages by number or range and keep the rest, then download. Processed locally, no upload.
