How it works
The open-source js-beautify library (MIT licence) re-indents the JavaScript according to its structure. Nothing about how the code runs is changed – only whitespace and line breaks.
Related tools
Frequently asked questions
Does beautifying change how my JavaScript works?
No – only whitespace and line breaks change.
Which library is used?
js-beautify 1.15, an open-source formatter.
Can I choose tabs?
Yes – pick Tabs under Indentation.
What does line wrapping do?
Breaks long lines at the chosen width where possible.
Is there a size limit?
Several megabytes format fine in a modern browser.
Can I minify again afterwards?
Yes – use the matching minifier.
Does it fix errors?
No – broken code is formatted as well as possible but not repaired.
Are empty lines kept?
Up to two consecutive empty lines are kept.
Does it work with code from DevTools?
Yes – paste any copied code.
Why are some lines still long?
Strings and some expressions cannot be split safely.
Is it the same as Prettier?
No – it is a different formatter with fewer opinions.
Can it unpack obfuscated code?
It reformats minified code; it does not reverse heavy obfuscation or recover original names.
Does it format JSON?
Yes, though the JSON Formatter also validates.
Does it support JSX or TypeScript?
Basic formatting may work, but they are not fully supported.
Is my code uploaded?
No – it is processed in your browser and never leaves your device.
Is it free?
Yes, with no sign-up or limits.
Can I open a file?
Yes – use “Open file”, or paste the code.
Does it work offline?
Once the page and its library have loaded, yes.
Can I copy or download the result?
Copy it with one click, or download where offered.
Does it work on a phone?
Yes, though large files are easier on a computer.
Last reviewed: 8 November 2026.