JavaScript Formatter — unminify and beautify JS
Turn minified JavaScript back into readable code.
Paste minified or tangled code and this JavaScript beautifier gives it back readable: proper indentation, one statement per line, brackets where your eyes expect them. It runs entirely in your browser, so the code never leaves your machine.
How to use JavaScript Formatter
The workflow is deliberately short, because you usually arrive here mid-debugging with no patience to spare: Paste the code into the input box — a snippet or a whole file, minified or merely messy. Pick your indentation: two spaces, four spaces, or tabs, to match the project you’ll paste it back into.
Press the button and copy the result from the output pane. Nothing is uploaded and nothing is stored: the transformation happens locally, which matters when the file belongs to a client or contains anything you would rather not send to a stranger’s server.
What a JavaScript beautifier actually does
Minification strips everything a machine doesn’t need — line breaks, indentation, spacing — to make files smaller for shipping. The result is correct and unreadable in equal measure: a production bundle is often one enormous line. Beautifying reverses the readable part: it re-inserts line breaks after statements, indents nested blocks so structure becomes visible, and spaces out operators. What it cannot reverse is renaming — if the minifier shortened variables to a, b and c, those names stay, because the original names were discarded for good. You get back the shape of the code, not its vocabulary; for reading a stack trace or tracing a function, the shape is usually enough.
Minified code is a letter written to machines. Formatting it is how you steam the envelope open.
HTML formatter on the same page
Broken markup travels with broken scripts, so an HTML formatter is included alongside the script tools. Feed it a collapsed page — everything on one line, tags jammed together — and it returns nested, indented markup where you can finally see which div never got closed. Like the rest of the page it works online with no install, which makes it the quick option when you only need to inspect one page’s source rather than set up a whole toolchain. Between the two modes, most “why does this page do that?” investigations can start and finish in one tab.
Questions and answers
- Will formatting change what my code does?
- No. Only whitespace and line structure change; the statements, names and logic stay exactly as they were. The output runs identically to the input.
- Can it restore original variable names from minified code?
- No tool can — minifiers throw the names away rather than encode them. You will get readable structure with the short machine-chosen names intact.
- Is there a size limit?
- Practical limits come from your browser’s memory, not from the tool. Typical bundles format fine; for something enormous, split it and format the part you actually need to read.