Skip to content

Sanitize PDF

Sanitize PDF

Strip JavaScript, auto-launch actions, embedded files and hidden metadata — then see exactly what was removed. Your file is never uploaded.

  • Runs in your browser
  • Nothing uploaded
  • No sign-up
  • Free, no daily limits
  1. 1Add your file
  2. 2Choose settings
  3. 3Download

Drop a PDF here

Choose a file

Select a PDF to inspect and clean · up to 100 MB · nothing is uploaded

This is not antivirus.

It removes the PDF structures that are commonly abused — scripts, auto-run actions, embedded files, hidden metadata. It cannot detect a payload obfuscated inside a page's content stream, inside an image, or inside a font program, and it does not scan for known malware signatures. For a file you genuinely distrust, use a real antivirus scanner and a sandboxed viewer as well.

Scripts & actions

Document JavaScript, /OpenAction and /AA auto-run triggers.

Embedded files

Attachments hidden inside the PDF container.

Hidden data

Metadata, IDs, EXIF and leftover revision data.

Your file stays on your device: the scan and the clean both run in your browser. The PDF itself is never uploaded — there is no server that could receive it.

Your file is safe

It is processed inside this browser tab and never uploaded, and it is gone when you close the page.

Good to know

  • Removes JavaScript, auto-launch actions, embedded files and hidden metadata.
  • The report lists only items that were verified present and purged.
  • If nothing needs removing, the tool reports zero findings instead of uselessly re-saving.

Sanitize a PDF Free Online

Sanitize PDF is a free, in-browser security utility that strips active code, auto-run triggers, and hidden embedded payloads from a PDF without uploading your file. A PDF is a complex compound document format rather than a simple visual snapshot. It can embed executable JavaScript scripts, launch actions triggered upon file opening, attached binary executables, and tracking metadata. TryDocsy dismantles these risk vectors in browser memory and generates a verified removal report showing every structural item purged.

Which Tool Do I Need: Redact, Sanitize, Remove Metadata, or Flatten?

Securing a PDF involves different mechanisms depending on what data needs to be removed. Here is how TryDocsy's four privacy tools differ in code execution and purpose:

ToolWhat It RemovesUnderlying Code ActionVector Text StatusWhen to Use
Sanitize PDFExecutable JavaScript, auto-actions, and embedded filesStrips /OpenAction, /AA, and names dictionary streams100% IntactNeutralising active payloads and macros before opening untrusted files
Redact PDFVisible text, photos, and signaturesFlattens redacted pages to JPEG at scale 2 (max 4M pixels)Removed on redacted pages; intact on clean pagesCensoring personal data, account numbers, and ID numbers
Remove MetadataDocument Info dictionary and XMP tracking streamsPurges Author, Title, Creator, Producer, and XMP blocks100% IntactScrubbing author identities and revision dates before public release
Flatten PDFInteractive AcroForm fields and annotationsMerges field widgets into static page content via getForm().flatten()100% Intact (Static)Locking submitted contract forms so fields cannot be modified

Sanitization Presets and Dictionary Categories in lib/pdf-sanitize.ts

TryDocsy structures sanitization into two automated presets and an itemised custom mode. Below are the exact dictionary structures targeted by our engine:

Safe Clean (Active Threats Only)

Focuses strictly on active, executable constructs that can execute code or trigger remote requests when opened. Visual appearance and form inputs remain completely unaffected.

  • JavaScript: Document-level scripts (/Names /JavaScript) and action dictionaries.
  • Auto-Run Actions: /OpenAction and /AA dictionaries that execute upon open, print, or close.
  • Launch and URI Triggers: Remote executable calls and network requests.
  • Embedded Attachments: File specification dictionaries carried inside the PDF container.

Strict Clean (Active Content + Metadata)

Combines all Safe clean rules with full privacy scrubbing. Rebuilds the document to eliminate all hidden metadata, reviewer comments, and revision streams.

  • All Safe Clean rules: Scripts, auto-run triggers, and embedded attachments.
  • Annotations and Forms: Reviewer notes, stamps, highlights, and AcroForm fields.
  • Metadata Streams: Document /Info dictionary (Author, Title) and XML /Metadata (XMP).
  • Binary Metadata: Embedded JPEG EXIF chunks, font descriptor metadata, and piece-info.

How to Sanitize a PDF

1

Upload PDF

Drag and drop or click to select your PDF file.

2

Pick a Preset

Safe clean, Strict clean, or Custom item-by-item control.

3

Sanitize

The document is rebuilt client-side without dangerous keys.

4

Review & Download

Read the verified removal report, then save the clean PDF.

Why Use TryDocsy to Sanitize PDFs?

No Server Uploads

An untrusted file is never transmitted to an external server; it is sanitized in your local browser.

Scripts and Auto-Actions

Removes document JavaScript plus /OpenAction and /AA open, close, and print triggers.

Embedded File Stripping

Removes concealed executable payloads carried within PDF container attachments.

Verified Removal Report

Every row is checked against a scan of your original, reporting only genuine removals.

Honest Security Boundaries

We state technical limits plainly rather than making unrealistic antivirus claims.

Free and Private

No subscriptions, no accounts, no watermarks, and no usage limitations.

Frequently Asked Questions

How do I remove malicious JavaScript from a PDF without Adobe Acrobat?

Select your PDF file in TryDocsy Sanitize PDF and click Sanitize PDF using the Safe clean preset. The tool searches the internal PDF dictionary for /JavaScript, /OpenAction, and /AA additional-action triggers and deletes them entirely before re-saving. You do not need Adobe Acrobat Pro to strip active payloads.

Is my untrusted PDF uploaded to an external server for scanning?

No. The scan and sanitization routines execute exclusively inside your web browser using WebAssembly. Files you distrust or suspect of carrying malware are never uploaded over the internet or saved to an external database.

What is the difference between Safe clean and Strict clean?

Safe clean removes active executable threats: JavaScript, /OpenAction, /AA auto-run triggers (which fire upon document open, print, or close), and embedded file attachments. Strict clean expands this to remove non-executable privacy structures: annotations, interactive AcroForm fields, document Info dictionaries, XMP metadata streams, document IDs, font metadata, EXIF profiles, and incremental update history.

Why does removing annotations also remove fillable form fields in Strict clean?

In the PDF standard specification, interactive form field widgets are structurally defined as annotation dictionaries (/Annots). Purging annotations inevitably removes all field controls and the root /AcroForm dictionary, which wipes any saved form answers.

Is TryDocsy Sanitize PDF an antivirus scanner?

No. This tool does not scan binary streams for known antivirus signatures. It strips the document object categories that malicious exploits use to execute code or deliver payloads. If a file is genuinely malicious, scan it with a dedicated antivirus program and open it within an isolated sandbox.

What is the difference between redacting, sanitizing, removing metadata, and flattening?

Redacting removes visible text and graphics by rasterising target pages. Sanitizing removes active JavaScript, auto-actions, and embedded file attachments. Removing metadata deletes author and identification streams without altering active content. Flattening bakes interactive form fields into static page content.

Related PDF Tools