JavaScript Beautifier
Beautify JavaScript online for free — paste minified or messy JavaScript (including JSON and modern ES syntax) and get clean, consistently indented code. Choose 2 spaces, 4 spaces or tabs, then copy or download. Powered by js-beautify; runs 100% in your browser.
100% private — everything runs in your browser. Conversion happens on your device; nothing is uploaded.
Formatting uses the open-source js-beautify library and runs entirely in your browser, so private code is never uploaded.
How to beautify JavaScript
- Paste your JavaScript (or open a .js file).
- Pick the indentation you use.
- Click “Beautify” — pasting also formats automatically.
- Copy the formatted code or download it.
What you can use it for
- Read minified JavaScript bundles
- Format code before reviewing or debugging
- Tidy snippets copied from Stack Overflow or DevTools
- Standardise indentation across a project
More free tools
Building for the web?
Format, minify, convert and generate code with our free, private developer tools.
See all free tools →Frequently asked questions
How do I format JavaScript?
Paste the code and click “Beautify”. Indentation, line breaks and spacing are rebuilt consistently, without changing what the code does.
Is beautifying the opposite of minifying?
Yes. Minifying strips whitespace for production; beautifying adds it back so people can read it. To minify again, use our JavaScript Minifier.
Does it de-obfuscate code?
It restores readable formatting, but it can't restore original variable names that a minifier shortened.
Can I keep braces on their own line?
Yes — set Brace style to “Next line”.
Is my code uploaded?
No. Formatting runs in your browser with the open-source js-beautify library, so private code never leaves your device.