Looking inside a min.js
Deployed JavaScript arrives with hundreds of thousands of characters on one line. Paste it here and the indentation and line breaks come back, so the structure can be read.
Useful when a bug fires somewhere inside a library and there is no source map, or when you
want to see what the a.js:1:48210 in a stack trace actually points at.
Variable names do not come back
Formatting restores whitespace only. If minification turned
userName into a, that is gone — the original name is nowhere in the
file any more. Same for comments.
To see something close to the original you need the source map (.js.map). If it
was published alongside, your browser's devtools will show you the original automatically.
Options
| Option | What it means |
|---|---|
| Brace placement | Same line (if (x) {) is the JavaScript convention. Automatic semicolon insertion makes a line break after return dangerous anyway |
| Line length limit | Wraps lines past the given width; 0 never wraps. For reading long method chains, 80–120 works well |
About this formatter
It runs js-beautify (MIT) inside your browser — the same engine beautifier.io uses. Your code is not sent to a server, so pasting something from work does not put it on the internet.
Will it make obfuscated code readable?
You will see the structure. But serious obfuscation — collecting all the strings into an array and pulling them out by index — does not yield to formatting. That is not compression; it was built to resist reading, which is a different problem.
Should I format JSON with this?
Use JSON Formatter instead. It validates the syntax and summarises the structure at the same time.