JavaScript Beautifier & Minifier

Pretty-print messy / minified JavaScript code, or minify hand-written JS for production. Uses js-beautify β€” the same library VS Code uses.

Runs in your browser.

When to beautify JavaScript

Minified JavaScript β€” what production sites serve to browsers β€” is essentially unreadable: !function(e){var t,n;...}(this); stretched across a single 50,000-character line. A beautifier reverses the minification: adds line breaks, indents nested blocks, formats argument lists. The semantic result is identical; only the layout changes.

Common reasons: reading the JS source of a website you don't own, debugging a minified bundle, auditing a third-party script before installing it, reverse-engineering a webpage's interactive behaviour, or just understanding code your build pipeline minified.

When to minify

Indent options

Tips

FAQs

Is anything uploaded?

No.

Will it break my JS?

Beautify is safe β€” it only changes whitespace. The basic minifier strips comments and whitespace; very rare edge cases (regex literals next to division-like syntax) can be affected.

Does it support modern syntax (async/await, ES2024)?

Yes β€” js-beautify keeps up with current syntax.

Related