About this tool
Paste minified or inconsistent JavaScript and get it back readable: one statement per line, consistent indentation, and your choice of brace style. It works on modern JavaScript (classes, arrow functions, async/await, optional chaining, template literals), on JSON, and with the JSX option on React components. It runs in your browser with js-beautify.
Reading minified code
Formatting restores the layout of minified code but not its names: a minifier has already renamed variables to a, b and c. If the site publishes a source map, your browser’s developer tools can show the original source instead.
Formatter or linter?
A formatter only changes whitespace and line breaks, so the code behaves exactly the same. It doesn’t catch mistakes; use the JavaScript Validator for syntax errors. In a project, Prettier or your editor’s formatter keeps everyone’s code consistent automatically.
FAQ
How do I unminify JavaScript?
Paste the minified code into the box. It is reformatted with line breaks and indentation as you type.
Can it restore the original variable names?
No. Minifiers replace names permanently. Only a source map, if the site publishes one, maps the code back to the original.
Does it work with TypeScript?
Mostly. TypeScript formats well in practice, though very new syntax may not be recognised. JSX needs the JSX option.
Will formatting change how my code runs?
No. Only whitespace and line breaks change.
Is my code uploaded?
No. Formatting runs entirely in your browser.