JavaScript Beautifier
Beautify and format minified JavaScript code with proper indentation.
Last updated: August 2026
Was this tool helpful?
Un-minifying JavaScript
A beautifier takes minified or messy JavaScript and reformats it with consistent indentation, line breaks, and spacing so it is readable. It only changes layout, not behavior; the parsed program is identical. This is the reverse of minification, which strips whitespace to shrink files for delivery.
When you need it
The usual case is inspecting a bundled or minified script from a web page to understand what it does, debugging a vendor file with no source map, or cleaning up code that was pasted without formatting. It also helps when diffing two scripts, since consistent formatting makes real changes stand out instead of drowning in whitespace noise.
Example
Minified:
function f(a,b){return a>b?a:b}
Beautified:
function f(a, b) {
return a > b ? a : b;
}Beautifying is not un-mangling
A key limit: minifiers also rename variables to short names like a, b, and n, and a beautifier cannot recover the original names. You get readable structure but not meaningful identifiers. Formatting choices like semicolon insertion and whether to expand single-line blocks are configurable and can differ from the author's original style.
FAQ
Will it get my variable names back? No. Minification discards them; beautifying only restores whitespace and layout, not the lost names.
Can it break my code? It should not change behavior, but auto-inserted semicolons on code that relied on ASI quirks is a rare edge; verify the output runs.
Does it work on JSON too? JSON is a subset, so it will format, but a dedicated JSON formatter validates structure and reports errors a JS beautifier may not.