JS Beautifier Details
JavaScript Beautifier breaks minified JavaScript onto separate lines and indents it so you can read it.
Use it to inspect a live script, follow the flow while debugging, or open a file before editing it by hand.
The workflow
Short version: give it input, run it, take the output. Details below.
- Paste the JavaScript into the box.
- Run the tool; the code is expanded with indentation.
- Copy or download the result.
Technical details
Formatting behaviour:
- Lines break at brace and semicolon boundaries with two-space indentation.
- Runs of blank lines collapse into one.
- The work happens in your browser; the code is never uploaded.
- Characters, lines and bytes are reported under the output panel.
When to choose this tool
This page is for readability; to reduce size use the JavaScript Minifier.
It is a text-level formatter, not a parser: it cannot restore names that a minifier shortened and does not read source maps. Braces and semicolons inside strings can cause unexpected breaks.
Small things that help
- Also try your browser's built-in pretty print — with a source map it gives better results.
- Do not ship the beautified file; ship the original source.
- Check the output line by line when the code contains template literals.
Where your data is processed
This tool runs entirely in your browser, so what you type is not sent to the server. The only request that leaves is a counter with no content in it. Third-party advertising cookies may be present on the page, and they cannot read your input.