Free JavaScript Beautifier
Paste or upload your JavaScript and format it instantly in your browser. Restores indentation and line breaks to minified or uglified code. Nothing is uploaded.
What beautification does
JavaScript beautification restores indentation, adds line breaks, and spaces out operators and keywords. Minified code that was compressed into a single line becomes a readable file you can step through and understand.
Useful for debugging third-party scripts, understanding vendor bundles, or reviewing minified code you received without the source. The formatter handles modern ES2020+ syntax including arrow functions, template literals, and async/await.
The formatter uses js-beautify under the hood, with 2-space indentation. All processing runs locally in your browser. Nothing is uploaded.
JavaScript Beautifier FAQ
Can I beautify minified JavaScript?
Yes. Paste any compressed or uglified JavaScript and get formatted, indented output. This is the primary use case — making production bundles and minified vendor scripts readable again.
Will beautifying restore original variable names?
No. If variables were mangled during minification (a, b, c instead of userName, totalPrice), beautifying restores structure and indentation but cannot recover the original names. The code will be formatted and readable, but short variable names stay short.
Does beautifying change how the code runs?
No. Only whitespace, indentation, and line breaks change. The logic, variable values, and control flow remain identical. The beautified code runs exactly the same as the original.
What's the difference between beautify and prettify?
Same thing. Both format code for readability by adding indentation and line breaks. You may also see it called "formatting" — all three terms describe the same operation.