JavaScript Formatter

Beautify minified or compressed JavaScript with consistent indentation

Input JavaScript

Formatted JavaScript

Nothing you paste here is ever uploaded — formatting happens entirely in your browser.

About this tool

Minified JavaScript strips out whitespace and line breaks to shrink file size for production, which is exactly what makes it unreadable when you need to inspect it. This formatter walks through the code and places each statement, brace, and semicolon on its own line, indenting nested blocks two spaces deeper for every level of brace depth. It's a lightweight, structural beautifier rather than a full JavaScript parser or AST-based tool, so it works well for getting a readable shape on typical code without needing to understand every language construct.

Does this un-minify variable names too?

No — it only restores spacing, line breaks, and indentation. If a minifier renamed your variables to single letters, this tool won't recover the original names since that information isn't in the minified code.

Will it work on modern JS with arrow functions and template literals?

Since formatting is driven by braces and semicolons rather than a full grammar, most modern syntax passes through fine, but very dense one-liners using unusual chaining or string content containing braces can occasionally format oddly — always spot-check the result on complex code.

Is this the same as a linter like ESLint or Prettier?

No — it only reformats whitespace and indentation for readability. It doesn't check for bugs, enforce a style guide, or understand JavaScript semantics the way a real linter or Prettier's AST-based formatter does.