Free Online JavaScript Formatter
Turn minified or messy JavaScript into clean, readable code.
Tip: Ctrl + Enter to format · Ctrl + K to clear
Formatted code will appear here.
How it works
- Paste minified or messy JavaScript.
- Choose indentation and brace style.
- Click Format (or press Ctrl + Enter).
- Copy the readable code or download it as a .js file.
Frequently asked questions
Can this reverse minified JavaScript?
It restores indentation and line breaks so minified code becomes readable again. Variable names shortened by a minifier (like a, b, c) cannot be recovered, because the original names are no longer in the file.
Does formatting change how my code runs?
No. Only whitespace and line breaks change. The formatter understands modern syntax such as arrow functions, template literals, classes and async/await.
Which formatter engine is used?
The tool uses js-beautify, a widely used open-source formatter, running entirely in your browser. It is loaded only on this page.
Is my code uploaded?
No. Your code never leaves your browser, so it is safe to format proprietary or unreleased source code.
Readable JavaScript from minified code
Minified bundles, inline scripts and code copied from browser dev tools are hard to follow. The JavaScript formatter restores indentation, line breaks and spacing so you can read, debug and review the code.
Formatting options
- Indentation — 2 spaces, 4 spaces or tabs to match your project.
- Brace style — keep opening braces on the same line, or move them to a new line.
- Keep blank lines — preserve intentional spacing between blocks.
- Break chained methods — put each
.then()or.map()call on its own line.
What formatting cannot do
A formatter only changes whitespace. Minifiers often rename variables to single letters; those original names cannot be recovered. For full debugging of production bundles, use the source maps generated by your build tool.
Also works for JSON-like code
Object literals and configuration files written in JavaScript format nicely too. For strict JSON with validation, use the JSON Formatter.