JavaScript Beautifier & Formatter

Paste minified JavaScript, get it back readable.

Why a tokenizer and not a search-and-replace

A regular expression cannot tell / the division sign from / the start of a regular expression, and it cannot tell a comment from the same two characters inside a string. Formatters built that way corrupt files quietly — the output still looks like code, and the damage surfaces later. This one reads the source as tokens, so a / b / c stays arithmetic and "// not a comment" stays a string.

What it will not do

It re-indents and spaces your code. It does not rewrite it: no reordering, no renaming, no changing how anything works. Running it twice gives the same result as running it once.

Frequently asked questions

Is my code uploaded anywhere?

No. The script is tokenized and re-indented in the page itself. The file is re-indented in the page itself, so unreleased source never leaves your machine.

Does it handle modern syntax?

Yes — arrow functions, template literals including nested ones, optional chaining, numeric separators and BigInt all tokenize correctly.

Can it fix broken code?

No. It reformats what you give it; it does not parse for errors or repair anything. Badly broken input gives badly formatted output.

Something wrong with this tool, or an idea for it? Tell us