100% local — your data never leaves your browser

JavaScript Formatter — Read a Minified Script

Reindent JavaScript. Strings, template literals and regular expressions come through untouched, and so do your comments — the code still runs.

Instant Private Zero cookies
Indentation

JavaScript input

JavaScript output

What this tool does

Minified or badly spaced JavaScript becomes readable JavaScript.

const a=[1,2,3].map(x=>x*2);if(a){b()}
const a = [1, 2, 3].map(x => x * 2);
if (a) {
  b()
}

Spaces around operators, one statement per line, one indentation level per block — two spaces by default, four if you prefer. The code that comes out runs exactly like the code that went in.

What minification took away, formatting cannot give back

function t(e){return e*2}
function t(e) {
  return e * 2
}

The structure is back; the names are not. Minifiers rename to save bytes, and the original multiplyByTwo is not hidden somewhere in the file — it is gone. Formatting is the only half that is reversible. If the site shipped a source map, that is what carries the names, and a browser’s dev tools will use it.

What it copies verbatim

  • Strings and template literals. "a b" keeps its two spaces: inside quotes, whitespace is a value, not layout.
  • Regular expressions. /a b/ is left alone — a space in a pattern matches a space.
  • Comments. Line and block comments keep their place, including a licence banner at the top of the file.

It is not a validator, and not a linter

Broken code comes back indented rather than reported, which is often what you want when you are hunting for the place it broke — but a tidy result is not a verdict. For whether it parses, run it or open it in your editor; for style and mistakes, use ESLint or the equivalent for your project.

Private by design

Everything runs locally in your browser with JavaScript. Your data is never uploaded, which makes the tool safe for sensitive content, and it keeps working offline.

Frequently asked questions

I pasted minified code and the names are still one letter.
They will stay that way. Minifying renames `userProfile` to `t`, and that rename is not reversible: the original names are simply not in the file any more. A formatter restores the whitespace and the line breaks, which makes the structure readable — the loops, the branches, the returns — but no tool can give back a name that was thrown away. A source map can, if the site published one.
Does it change my code?
Only its whitespace. Strings, template literals and regular expressions are copied as they are — a space inside `"a b"` or inside `/a b/` is part of the value, not layout. Nothing is renamed, nothing is reordered, no semicolon is added: this is a layout pass, not a rewrite.
Is it a linter?
No. It says nothing about unused variables, `==` versus `===`, or a `let` that should be a `const`. It does not even check that the file parses: broken JavaScript comes back reindented, which is often useful for finding where it broke, but it is not a verdict. ESLint and your editor do that job.

Related converters