Free forever · no signup

PDF JavaScript detector — find embedded scripts before sharing

Surface every embedded JavaScript in a PDF: page-load scripts, form-submit handlers, link-click triggers, and document-level actions. Critical for security pre-flight before sharing PDFs from untrusted sources.

No watermarks No signup Stays on your device
Drop your PDF here
or choose a file
Choose file
FREE · UNLIMITED · NO LIMITS
HOW IT WORKS

Three steps. No surprises.

1
Drop the PDF
Up to 100 MB. We walk the document /Names tree, /OpenAction entry, every annotation's /A and /AA dictionaries, and every form field's /A dictionary to find every JavaScript binding.
2
Browse the script table
Each script: trigger (page-load / form-submit / link-click / before-print / etc.), source code (collapsible), and the host element (page number, form field name, link annotation).
3
Inspect or strip
Read the script source to assess intent. To remove: use our Strip JavaScript tool (paid) or open in Acrobat Pro and run "Sanitize Document".
WHY PDFCRAFT AI

Not just pdf javascript detector. A whole PDF stack.

113 tools
Every PDF task in one place. 60 free forever, 53 AI.
Macros
Chain steps. Schedule them. Never do the same job twice.
Bulk mode
Run any tool on up to 500 files at once — drop a zip, get a zip back.
Private by default
Free tools run in your browser. AI uploads are encrypted in transit and never stored — metadata only. Never used for training.
THE FULL GUIDE

PDF JavaScript detector — what's running inside the PDF and why most documents shouldn't have any

Most PDFs are static documents — text, images, vectors, sometimes form fields. A subset can also carry JavaScript: actual executable code that runs when the document is opened, when a form is submitted, when a link is clicked, when a button is pressed. Legitimate uses exist — form validation, dynamic field calculations, copy-protection schemes — but JavaScript inside a PDF is also a major vector for phishing, exfiltration, and tracker-pixel-style telemetry. Here is how PDFs can run code, the four trigger points the detector surfaces, and the patterns that distinguish benign automation from malicious payloads.

How JavaScript ends up inside a PDF

The PDF spec includes a JavaScript runtime — a subset of JavaScript intended for in-document interactivity. Code can be attached at four levels of granularity: at the document level (runs on open), at the page level (runs when a specific page is shown), at the field level (runs on field events like input or validation), and at the annotation level (runs when a link is clicked, a button is pressed, or a checkbox is toggled). The /Names tree, /OpenAction entry, every form field's /A (action) and /AA (additional action) dictionaries, and every annotation's /A and /AA dictionaries all carry potential script bindings.

The detector walks every one of these locations and surfaces every script binding it finds, along with the trigger (when the script fires) and the source code. Readers that don't run JavaScript (Chrome built-in PDF viewer, Firefox built-in, Edge built-in) ignore the scripts entirely — those readers are the safest for unknown PDFs. Acrobat, Foxit, Nitro each have their own JS engines that DO execute scripts.

Four trigger points the detector surfaces

Each trigger has different risk implications:

  • Document open (/OpenAction). Runs as soon as the PDF is opened. Highest-risk trigger — a malicious page-load script can phone home, log open events, or fire credential-phishing prompts. Modern Acrobat prompts on JavaScript at open; users frequently click through without reading the prompt.
  • Page load. Runs when a specific page is shown. Lower-frequency than open-action but still automatic. Used legitimately for context-specific form validation; used maliciously for paging-based tracking.
  • Form submit and field events. Runs on form interaction. Most common legitimate use: client-side validation ("this field requires a 5-digit zip code") or calculated fields ("total = quantity × price"). Most common malicious use: data exfiltration via submitForm to an attacker-controlled URL.
  • Annotation actions (link click, button press, checkbox toggle). Runs on explicit user action. The user clicked something; the script fires. Acrobat usually does NOT prompt for these even though they're scripts. Pre-flight inspection is essential because the script is hidden behind a normal-looking UI element.

Distinguishing benign from malicious

Reading scripts requires judgment. Three patterns that signal real risk:

  • External URLs in any non-link-click trigger. Page-load or document-open scripts containing http:// or https:// strings are red flags. Legitimate validation scripts don't need to hit a server. Tracking pixels embedded as JavaScript do.
  • submitForm to a domain different from the document's source. If you received the PDF from contoso.com and the submitForm sends to evil.example.org, that's exfiltration. Acrobat doesn't prompt for this.
  • Eval, unescape, or string-concatenation that builds the actual script at runtime. Obfuscation. Legitimate scripts have no reason to construct themselves at runtime; this pattern is almost exclusively malicious.

When to strip vs when to keep

Three decision categories:

  • Strip immediately. PDFs from unknown senders, PDFs flagged by security scanning, any of the three malicious-pattern signals above. Run Strip JavaScript (paid) or open in Acrobat Pro and use Sanitize Document.
  • Keep and document. Legitimate forms with client-side validation. Internal documents from trusted creators where the JavaScript performs known automation. In these cases, the detector output goes into the compliance file alongside the document for future audit.
  • Strip but archive the original. Documents being put into long-term archival storage. PDF/A forbids JavaScript; you have to strip. But if the original needs to be preserved for some reason, archive both versions.

What readers do with JavaScript

Reader-specific behavior matters for risk assessment:

  • Adobe Acrobat (since v11). Prompts before executing JavaScript at document-open. Does NOT prompt for field / annotation triggers. Settings can disable JS entirely.
  • Foxit, Nitro. Each has its own JS engine with similar prompt-on-open behavior but different defaults. Worth checking your organization's reader policy.
  • Chrome / Edge / Firefox built-in PDF viewers. Do not execute PDF JavaScript at all. Safest for unknown PDFs — open in browser first, run through the detector to inventory the JS, then decide whether to open in Acrobat.
  • macOS Preview. Limited JS support; many scripts simply don't fire. Reasonable middle-ground for casual PDF viewing.

Limits and compatibility

On the free web tool, the JavaScript detector handles PDFs up to 100 MB. Parsing runs in your browser via byte-level parsing; nothing is uploaded — important for forensic and threat-hunting workflows where the file itself IS the suspicious artifact. Output lists every script with trigger, source code, and host element. Exportable for inclusion in security reviews.

Common pairings: JS Detector → Strip JavaScript to remove findings. JS Detector → PDF Inspector for full structural audit of suspicious PDFs. JS Detector findings → flag the PDF for organizational quarantine before sharing further.

WHAT USERS SAY

From people who switched

★★★★★
“Switched my whole bank-statement workflow off iLovePDF in an afternoon. The unlimited free tier alone saves me $5/month, and the AI summarize on long contracts is the killer feature.”
— Marcus, freelance accountant
★★★★★
“We were paying for Smallpdf Pro for 4 seats and it still hit daily limits during quarter close. pdfcraft ai handled the same workload at one quarter the price with no caps.”
— Priya, Operations Lead at a SaaS startup
★★★★★
“The Compare PDFs tool with AI severity classification saved me at least 4 hours per redline. I do contract review at the firm, this is now part of my muscle memory.”
— James, In-house counsel
FAQ

Questions people actually ask.

PDF JavaScript can phone home (ping a tracker URL on every open), execute on form-submit (exfiltrate data), or trigger fake-prompt dialogs for credential-phishing. Most legitimate PDFs don't have JavaScript; the ones that do (interactive forms, document-protection schemes) should be auditable.

Ready to pdf your first PDF?

No signup. No watermarks. Your file stays private.

Open PDF JavaScript Detector
Customize