JavaScript Formatter & Beautifier
Beautify minified or messy JavaScript into properly indented, readable code.
How this tool works
Paste minified or messy JavaScript
A compressed production bundle or just inconsistently formatted code.
js-beautify restructures it
js_beautify rebuilds proper indentation, brace placement, and line breaks.
Adjust the indent size
Switch between 2 and 4 spaces so the output matches your linter config.
Copy the readable code
Logic and variable names stay exactly as written - only whitespace changes.
Quick facts
- Category
- Formatters & Beautifiers
- Best for
- Un-minifying a script to review a third-party library
About this tool
Paste minified or inconsistently formatted JavaScript and get it beautified with proper indentation, consistent brace and bracket placement, and sensible line breaks - powered by js-beautify’s js_beautify, the same widely used beautification engine that also powers this site’s CSS and HTML formatters. This is the direct counterpart to the JS Minifier: that tool strips whitespace out for production, this one expands the code back into a readable shape for review, debugging, or understanding a third-party script. Variable names, logic, and behavior are completely untouched - only whitespace, indentation, and line breaks change, so the beautified code runs identically to the original. Everything runs client-side, so pasted code never leaves your browser.
Why use this tool
Makes a third-party bundle readable
Paste a vendor script or production bundle and get back something you can actually step through.
Driven by js_beautify
Relies on js-beautify’s JavaScript-specific engine rather than a generic text formatter.
Behavior stays identical
Only whitespace and indentation change - logic, variable names, and operator precedence are untouched.
Reversible with the JS Minifier
Compress a script for production, then bring it back here later if you need to read it again.
Frequently asked questions
Yes - the JS Minifier strips comments and collapses whitespace to shrink file size for production, while this formatter does the reverse: it expands compressed or inconsistently indented code back into a readable, properly indented form. Running a minified file through this formatter and comparing it to the original source is also a quick way to check whether the minified version still matches expectations.
No - only whitespace, indentation, and line breaks are changed. Variable names, logic, operator precedence, and every other meaningful part of the code stay exactly as written, so the formatted output runs identically to the original; the only difference is how easy it is for a person to read.
Explore more free tools
Formatters, converters, validators, and generators - all free and running entirely in your browser.
Browse more tools