Reading a compact stack-trace snippet
Lay out copied JavaScript to make block and expression boundaries easier to follow.
Use the source map for exact source locations and original identifiers when the build supplies one.
Expand minified or cramped JavaScript into readable two-space-indented code with copying, samples, and `.js` download.
Content last reviewed
67 characters · 1 lines
Structure comes back; names don't — variables minified to single letters keep their minified names. For debugging your own production code, source maps are the proper fix.
Overview
Run js-beautify's JavaScript formatter with a fixed two-space indent, then copy or download the readable result. Line breaks and indentation return; renamed identifiers, removed comments, bundled module boundaries, source filenames, and original intent do not.
The page targets JavaScript syntax rather than TypeScript, JSX, or a repository's full parser stack.
One fixed setting keeps the single-purpose interface predictable.
Short names, removed comments, and build transformations remain exactly as supplied.
Copy or download the output for inspection without executing it.
How it works
Three steps, in the order the tool above actually takes them.
Treat unknown code as untrusted and do not execute it merely because it becomes readable.
Follow blocks, calls, literals, and control flow while remembering names may have been minified.
For your own build, map back to authored modules and names instead of relying on formatting alone.
Use cases
The jobs this page is usually opened for, and the setting that makes each one quick.
Lay out copied JavaScript to make block and expression boundaries easier to follow.
Use the source map for exact source locations and original identifiers when the build supplies one.
Create a readable view for security or integration review without executing the source.
Beautification does not establish safety, licence, provenance, or absence of dynamic behavior.
Compare readable structure with permanently shortened names and removed comments.
The output can be easier to read while still being far from the authored source.
Formatting restores layout only
Whitespace is recoverable because structure implies sensible layout. Identifier names, comments, module boundaries, dead code, and original file locations were discarded or transformed and require source maps or source access.
| Artifact | Beautifier result | Better source |
|---|---|---|
| Indentation | The exact author's layout returns. | A consistent new two-space layout is generated from the current syntax. |
| Identifier names | a and b become descriptive variables again. | The formatter preserves the supplied names; only a source map may link them back. |
| Comments | Meaning can be inferred and comments regenerated. | Removed commentary is unavailable and should not be fabricated. |
| Behavior | Readable output is automatically safe to run. | Formatting neither executes nor audits the code; review unknown source as untrusted. |
The exact author's layout returns.
A consistent new two-space layout is generated from the current syntax.
a and b become descriptive variables again.
The formatter preserves the supplied names; only a source map may link them back.
Meaning can be inferred and comments regenerated.
Removed commentary is unavailable and should not be fabricated.
Readable output is automatically safe to run.
Formatting neither executes nor audits the code; review unknown source as untrusted.
Privacy
JavaScript input is formatted as local text and never executed, uploaded, or autosaved.
Encoding, parsing, formatting, generation, comparison, and cryptographic operations run in browser code. Form values and uploaded text files are not sent to a processing API.
Code, tokens, secrets, URLs, and generated outputs stay in component memory until the page reloads or closes. Split-pane tools remember only the divider percentage for the current tab session.
The page reads the clipboard only after a Paste action and writes it only after Copy. A local download is created only when you choose the tool's download control.
The page shell can send the tool slug, never the editor contents or filename. The endpoint is rate-limited using a transient requesting address and is skipped for Do Not Track or Global Privacy Control.
More detail in how processing works and our privacy policy.
Limits
The values this tool actually enforces, not a rounded-up version.
JavaScript only — TypeScript annotations and JSX are outside the parser's grammar and may be formatted incorrectly. It formats; it does not lint, transpile, un-minify identifiers or resolve source maps. Indentation is fixed at two spaces with no configuration exposed on this page.
FAQ
The ones that actually come up.