Beautify JavaScript Online — Format & Unminify JS

Turn minified or messy JS back into something a human can read.

🔒 Runs in your browser — files never uploaded ⚡ No signup 💯 Free

Format JavaScript into readable, consistently indented code — including unminifying production bundles when you need to read what a site actually ships. Powered by js-beautify, the formatter behind countless editor plugins, running locally in your browser.

Pick 2 spaces, 4 spaces or tabs; the structure does the rest.

How to use JavaScript Beautifier

  1. Paste JavaScript — minified, badly formatted, or from a template literal.
  2. Pick your indent style.
  3. Click Beautify and read the structured result.
  4. Copy or download as a .js file.

What unminifying can and cannot recover

Formatting is fully recoverable: line breaks, indentation, spacing all come back. What's gone for good is what minification destroyed rather than compressed — mangled variable names stay as a, b, c, and comments are simply absent. You get readable structure with anonymous actors, which is usually enough to follow the logic; recovering intent takes source maps, which only the site's developers have.

Debugging production issues

The classic use: an error points at bundle.min.js:1:48213, which is useless in a one-line file. Beautify the bundle and the column becomes a real line you can read. (Browser dev tools' {} "pretty print" button does this too — this page is for when you have the code as text rather than loaded in a debugger.)

Formatting as a habit

For your own code, a formatter's value isn't beauty — it's the end of formatting decisions and diff noise. If you're pasting here regularly, the systematic fix is Prettier or an editor format-on-save; this page is the no-setup version for one-off files and other people's code.

Frequently asked questions

Can this recover the original variable names?

No — mangling is one-way. The names were replaced with a, b, c and the originals aren't in the file. Formatting comes back perfectly; identity doesn't. Recovering names needs the source map, which only the code's authors have.

Is it safe to paste proprietary code here?

It stays in your browser — the formatter is a local library and this page makes no request with your code. That said, the honest rule for any sensitive source is: check the network tab, then decide. Here it will be empty.

How does this differ from Prettier?

Prettier is opinionated and rewrites style decisions (quotes, trailing commas, line width); js-beautify — used here — is a formatter that mostly adds structure without restyling choices. For a build pipeline, use Prettier; for making pasted code readable, this is the lighter touch.

My error says bundle.min.js line 1 column 48213 — now what?

Beautify the bundle, then count: the beautified line at roughly that character offset is your culprit. Browser dev tools can also pretty-print in place and map the column for you — this page is for when you have the file as text.