CalculatorsConvertersDeveloperTextAll toolsDirectory
Submit your tool Sign in
Theme
Home/Answers/Developer
How-to

How do I unminify JavaScript so I can read it?

Short answer

Run the minified code through a formatter, which re-adds line breaks, indentation and brace structure so the logic becomes readable again. Formatting cannot restore original variable names that minification shortened, but it makes the control flow easy to follow. A browser-based JS formatter does this on your own device, so proprietary or internal code is never pasted to a server.

What unminifying can and cannot recover

Minification strips whitespace and usually renames local variables to single letters. A beautifier reverses the first part completely: it expands one-line code into properly indented blocks with clear brace structure. The renamed identifiers stay renamed, since the original names are simply gone, but in practice indented structure is enough to trace what a script does, debug a production issue or inspect a third-party snippet.

Keep the code on your machine

The JavaScript people need to unminify is often someone's production bundle or an internal script, not something to paste into an arbitrary website. A client-side formatter parses and reprints the code entirely in your browser, so nothing is transmitted or logged. The same applies to minified stylesheets, which a local CSS formatter expands into one declaration per line.

Step by step

  1. Copy the minified code. Copy the one-line or minified JavaScript you need to read.
  2. Paste it into the formatter. Open the JS formatter and paste the code. It is processed locally.
  3. Read the result. Copy out the indented, readable version and trace the logic.

Frequently asked questions

Will I get the original variable names back?

No. Minification discards the original names, so formatting restores structure and readability but not identifiers.

Is the code sent to a server?

No. Formatting runs entirely in your browser, so the script never leaves your device.

Can I unminify CSS the same way?

Yes. A companion CSS formatter expands minified stylesheets into clean, indented rules locally.

Related answers