← Back to tool

Beautify · Unminify · Copy

JS Beautifier

Updated: June 2026

A minified script is one or two enormous lines with every space squeezed out. A JS beautifier expands it back into indented, line-by-line code so you can read a library, debug a production bundle or understand a snippet you only have in compressed form.

Beautify My JS →

Free · No upload · Instant in the browser

Turn one line into readable code

The beautifier tokenises your JavaScript and re-prints it with proper indentation: every block is stepped in by its depth, every statement gets its own line, and braces line up so the structure is visible. It understands strings, template literals, regular expressions and comments, so nothing inside a literal is misread as code. Your spacing inside expressions is kept, which means readable code stays readable and minified code becomes readable.

The output is deterministic and semantically identical to the input — beautifying changes whitespace and line breaks only, never behaviour.

Debugging minified bundles

The classic use case is a production error. Your monitoring reports a crash at app.min.js:1:24816, which tells you nothing while the file is a single line. Paste it into the beautifier and that one line becomes thousands, each mapping to a real statement, so you can scroll to the function that threw and read the surrounding logic.

It is just as handy for inspecting a third-party widget, an inline analytics snippet or any script you found compressed and need to understand before trusting it.

What beautifying does and does not do

  • It restores indentation, line breaks and block structure.
  • It keeps every comment that survived in the source.
  • It does not rename minified variables back to meaningful names.
  • It does not change what the code does — output and input behave identically.

In short, it gives you back the shape of the code, which is what you need to follow the control flow even when the names are terse.

Modern JavaScript is supported

Arrow functions, template literals, optional chaining, nullish coalescing, spread and rest, async/await and the full operator set are all tokenised correctly, so modern code beautifies cleanly rather than breaking on unfamiliar syntax. Because the beautifier reads the code structurally instead of with fragile regular expressions, it handles edge cases — a slash that is division versus a regex, a brace inside a template — without mangling them.

Local and private

Beautifying runs entirely in your browser. The script you paste — which may hold endpoints, keys or unreleased logic — is never uploaded. Watch the network tab and you will see no request while you beautify; go offline and the tool still works. There is no server round-trip, so even a large bundle expands the instant you paste it.

Frequently asked questions

How do I unminify JavaScript?

Paste the minified JS into the tool and keep Beautify selected. It expands the code into readable, indented lines you can scroll and search.

Does it rename minified variables?

No. Beautifying restores whitespace and structure but cannot recover original variable names, which minification discards.

Will beautifying change behaviour?

No. Only whitespace and line breaks change. The beautified code runs exactly the same as the input.

Is my code uploaded anywhere?

No. All processing runs locally in your browser. Nothing is sent to a server and the tool works offline once loaded.