JavaScript Formatter: Beautify JS Code Online
Unpack one-line JavaScript into readable code so you can follow the logic, debug or review it.
- Works on your device. Nothing is uploaded.
- Free, no watermark
- No signup
How to use
- Paste JavaScript or open a .js file.
- Choose 2 spaces, 4 spaces or tab.
- Copy or download the formatted code.
Good to know
The formatter (js-beautify, MIT licence) adds line breaks after statements and braces, indents blocks and keeps your comments. It understands modern syntax such as arrow functions, classes, template strings and async/await.
Formatting does not rename anything. If the code was minified with short names like a, b and c, those names stay; the original names cannot be recovered. It also does not run or check your code.
Useful for reading a third-party script before adding it to your site, for reviewing a snippet from a tutorial, or for making a long one-line file readable during debugging.
Questions
Can it un-minify any script?
It restores layout, not the original variable names or comments.
Does it support TypeScript?
Plain TypeScript usually formats well, but types-heavy code may look odd; it is built for JavaScript.
Will it change how my code runs?
No. Only whitespace and line breaks change.
Can I format JSON here?
Yes, though the JSON formatter also checks for errors.
Is my code uploaded?
No. It runs in your browser.