JavaScript Beautifier & Minifier

Reindent minified or obfuscated JavaScript so you can read it, or minify your own code to ship it smaller.

Indent
Names
Paste or type JavaScript to beautify or minify it.

Your JavaScript is formatted and minified in your browser. Nothing is uploaded to BroBroGo.

FAQ

What's the difference between beautify and minify?

Beautify re-indents and spaces out the code so it's easy to read and step through — the quickest way to make sense of a minified or obfuscated file. Minify does the opposite: it strips whitespace, comments and dead code so the file downloads faster. Beautify to read, minify to ship.

Can it turn minified code back into the original?

It restores the indentation and line breaks so the logic is readable again, but it cannot bring back the original variable names or comments — minifying throws those away for good, so no tool can recover them. What you get is the same code, laid out clearly.

What do the Shorten and Keep name options do?

Both strip whitespace, comments and unreachable code, and neither changes what your script does. Shorten also renames local variables to a single letter for the smallest possible file — the one you would ship. Keep leaves your names as they are, so the result is a little larger but still readable and easy to debug.