JavaScript Formatter & Beautifier
Paste minified scripts, JSON-like objects and messy JavaScript and get neatly indented, readable JavaScript in one click. Ideal for debugging, code reviews and understanding code you did not write.
Free · No sign-up · Files stay on your device
How to use JavaScript Formatter
- 1Paste your JavaScript.
- 2Choose the indentation.
- 3Click "Format", then copy or download the result.
Features
- One-click formatting
- 2 spaces, 4 spaces or tabs
- Handles minified code
- Copy or download the result
- Code never leaves your browser
How formatting works
Statements, blocks and objects are indented consistently. The code is reformatted only, never changed, so it runs exactly the same.
Formatting vs. minifying
Formatting adds whitespace to make code readable for people. Minifying removes it to make files smaller for browsers. Keep formatted code for editing and minify it for production.
Frequently asked questions
Will formatting change how my code works?
No. Only whitespace and line breaks change.
Can it fix syntax errors?
No. It formats valid code; with errors, the output may look odd around the broken part, which can help you find it.
Is my code uploaded?
No. Formatting happens entirely in your browser.