JavaScript beautifier
Paste minified or badly formatted JavaScript and get clean, indented code with one statement per line. Only whitespace changes; the code does exactly the same.
How it works
-
Paste your code
Paste the code in the left box or open a file. No code to hand? Click Example.
-
Instant result
The result appears as you type. If there is an error, you see the line and character.
-
Copy or download
Copy the result with one click or save it as a file for your editor or project.
When is it useful?
To read a minified script from a website, to tidy up code copied from a forum, or to see what a bookmarklet actually does. The beautifier adds line breaks and indentation, and spaces around operators, while strings, template literals and regular expressions stay untouched.
Options
- Indent: 2 spaces, 4 spaces or a tab.
- Braces: on the same line (
if (a) {, the usual JavaScript style) or on a new line.
This is formatting, not deobfuscation: variable names that were shortened to a and b stay short. It uses js-beautify, running in your browser. Formatting CSS instead? Use the CSS beautifier.
Frequently asked questions
Is the javaScript beautifier free?
Yes. The javaScript beautifier is completely free, with no account, sign-up or usage limit.
Is my code stored?
No. Your code is processed in your browser and is not sent to a server or stored.
Does it work on my phone?
Yes. The tool works in any modern browser on a phone, tablet or computer.