Skip to main content
PPDF123

Find JavaScript Inside a PDF

Show JavaScript scans a PDF for embedded JavaScript and returns the script text as a plain-text file. It reads scripts and never runs them. If none is found, the file says so.

Drag and drop files here, or click to choose

Accepts PDF · up to 500.0 MB per file · up to 20 files at once

You can also paste a file with Ctrl/Cmd+V, or from the clipboard menu.

Show JavaScript scans a PDF for embedded JavaScript and dumps the scripts as `text/plain`. It reads the catalog's JavaScript name tree, the catalog and page additional actions (`AA`), `OpenAction`, and the actions on annotations and form fields, following action chains. It does not execute JavaScript.

If nothing is found, the body is the sentence `No JavaScript actions found`. Password-protected files are unlocked for you on this page once you enter the password; API callers run Unlock first if they cannot be parsed.

This is an inspection dump, not a sanitizer. To strip JS, use Sanitize with removeJavaScript.

Embedded file attachments are a different store; use attachment tools, not this dump.

Where the scripts come from matters for reading the result. Document-level scripts live in the catalog's JavaScript name tree and normally run when the file opens. An `OpenAction` can run a script at open time too. Page actions fire when a page is shown or hidden, and annotation or form-field actions fire on a click, a keystroke, a focus change or a calculation. The dump merges all of these into one stream of text, one script after another, without labels saying which object each came from, so you identify the source by reading the code.

JavaScript in a PDF is mostly benign. Fillable forms use it to format a date, add up line items, or check that a required field is filled. Trouble usually looks different: a script that opens a URL, submits form data to an address, launches another file, or hides what it does behind long encoded strings. The sensible workflow is to dump the scripts, read them, and decide whether the document should be opened in a full-featured viewer at all.

The scan follows action chains, so a script reached through a `Next` action is included, and a chain is cut off at a fixed depth so that a looping file cannot hang the tool. It reads script text only. A script that is not stored as a plain string or a readable stream, or that lives in an XFA form's own script section, is outside what it can show.

The result is a plain text download, not a PDF, and the original file is not modified. Treat the text as untrusted content: do not paste it into a console or run it. Reading code in an editor is safe; the risk comes only from executing it.

Features

  • Plain-text dump of JS actions; no execution
  • Empty case returns a fixed sentence
  • Not Sanitize
  • Anonymous API at /api/v1/misc/show-javascript

When to use this tool

  • Inspect OpenAction before opening a file in a trusting viewer
  • Copy embedded scripts for review
  • Confirm a form has no catalog JS the walker can see
  • Check an unexpected invoice or attachment from an unknown sender before opening it
  • Understand how a calculating form works before reusing it
  • Document what a file does before a security team decides on it

How do I check a PDF for JavaScript?

  1. Upload a PDF you are allowed to inspect.
  2. Click Process and download the text file.
  3. Search the dump for app.alert or submitForm if you are hunting malware-ish actions.
  4. Use Sanitize if you need the JS gone from a copy.

Limits and edge cases

  • Not an executor
  • Scripts in unusual objects or XFA forms can be missed
  • Not a cleaner
  • Output carries no labels for the page, field or object a script came from
  • A clean result is not proof the file is safe: other content types are not examined
  • Upload limit on this website: 500 MB per file, sent in chunks above about 95 MB. A single direct API request body is capped at 100 MB.

Examples

  • A PDF with OpenAction JS downloads as a .txt of that script
  • A plain text memo downloads the no-JS sentence
  • A purchase-order form with a calculate action on its total field returns a short arithmetic snippet that sums the line-item fields
  • A file whose open action contains a call to submit data to an address returns that call as readable text, which tells you to stop before opening it

Privacy for this tool

Files are uploaded over HTTPS, processed in memory or a short-lived temporary directory on our servers, and deleted when your result is ready. We do not keep copies for later browsing, training, or advertising profiles. See the Privacy Policy for retention details and AdSense cookie disclosures.

Frequently asked questions

Does this run the scripts?
No. It only copies source text out of action dictionaries.
Why did I get No JavaScript actions found?
The scan found no JS in the places it reads. Scripts in unusual objects or XFA forms can still be missed.
Is this a malware scanner?
No. It is a dump. You still have to read it.
Will this remove JS?
No. Sanitize is the removal tool.
Is JavaScript in a PDF always dangerous?
No. Many legitimate forms use it for date formatting, totals and validation. What deserves attention is code that opens addresses, submits data, launches files or is deliberately obscured.
Why does my fillable form contain scripts?
Form fields can carry format, keystroke, validate and calculate actions written in JavaScript. A form that adds up a column or restricts input to digits will show those snippets in the dump.
Can I tell which page or field a script belongs to?
Not from the dump. Scripts are written out one after another without labels, so use the code itself, such as field names it references, to locate its source.
Does opening this tool's result run the code?
No. The download is a text file. Opening it in a text editor only displays the characters. Running it elsewhere is a separate step you should not take with code you did not write.
What do I do after finding suspicious scripts?
Do not open the original in a viewer with scripting enabled. Run Sanitize with removeJavaScript on a copy if you must use the file, or ask the sender where it came from.

Last updated:

Call this from code

Every tool on this site is a plain REST endpoint - no account or API key needed for anonymous use. Built for AI agents and developers as much as for browsers.

curl -X POST "https://pdf123.xyz/api/v1/misc/show-javascript" \
  -F "[email protected]" \
  -o output.pdf

Also available as an MCP tool for agent clients that speak Model Context Protocol (JSON-RPC 2.0 over POST /mcp). Full API reference

Use it from an AI agent

Skill

Claude Code, Codex, Cursor and other AI agents can run Show Javascript for you with this skill: /skills/pdf123-show-javascript.md

All agent skills

Files are used only for this processing job and deleted automatically afterward.