JavaScript Beautifier
Paste minified or unformatted JavaScript to reformat it with consistent indentation and spacing. Formatting runs entirely in your browser, so your code is never uploaded.
Loading…
About the JavaScript Beautifier
This tool re-indents minified or messy JavaScript into readable code using the well-known js-beautify library. It restores line breaks, consistent indentation, and spacing around operators and braces, so a single-line bundle becomes something you can actually read and follow. It is useful for inspecting a minified script, understanding third-party code, or tidying snippets pasted from elsewhere.
How to use it
- Paste the minified or unformatted JavaScript.
- The beautifier reflows it with clean indentation automatically.
- Scan the readable output to understand the logic.
- Copy the formatted code back into your editor.
A common use case is making sense of a minified vendor file during debugging. Note that beautifying only changes layout - it does not rename mangled variables like a, b, or c back to meaningful names, since that information is lost during minification. It also does not lint or fix bugs. All formatting runs in your browser, so your code is never uploaded.
Frequently asked questions
Will the beautifier restore original variable names?
No. Minifiers replace names with short tokens and that mapping is gone. The beautifier can fix indentation and spacing but cannot recover the original identifiers.
Does it change what my JavaScript does?
No. It only adjusts whitespace and line breaks. The code's behavior is unchanged because no statements are added, removed, or reordered.
Can it format modern syntax like arrow functions and classes?
Yes. It is built on js-beautify, which handles modern ECMAScript syntax including arrow functions, classes, template literals, and async/await.
Is my code uploaded to be beautified?
No. Formatting runs entirely in your browser, so your JavaScript never leaves your device.