About JavaScript Beautifier & Minifier — Unminify Code
Minified JavaScript bundles are nearly impossible to read — everything collapsed onto a single line, variables renamed, whitespace stripped. This free JavaScript beautifier un-minifies that code back into clean, indented source so you can actually follow what a production bundle is doing. It also works the other way: a one-click minifier shrinks your source for size checks and quick experiments.
The formatter is powered by Prettier and handles modern ES2020+ syntax — optional chaining, nullish coalescing, BigInt, and TypeScript too. Syntax errors are surfaced with a readable message instead of crashing. Everything runs locally in your browser, so the code you paste never leaves your device.
Features
- Beautify (pretty-print) JavaScript and TypeScript with Prettier
- Minify JavaScript with Terser and see how much smaller it gets
- Toggle semicolons and single vs double quotes; choose JS or TS
- Handles modern ES2020+ syntax with clear, non-crashing errors — fully offline
How to use
- Paste your JavaScript or TypeScript into the input pane.
- Choose Beautify to pretty-print, or Minify to compress.
- Adjust the language, semicolon, and quote options if needed.
- Copy the formatted result from the output pane.
Frequently asked questions
Can it un-minify a production bundle?
Yes. Beautify re-indents and spaces out minified, single-line code so it is readable again. It cannot restore original variable names (minifiers discard them), but the structure and logic become easy to follow.
What is the difference between beautify and minify?
Beautify adds consistent indentation, line breaks, and spacing to make code readable. Minify does the opposite — it strips whitespace and shortens names to make the file as small as possible for production.
Does it support TypeScript?
Yes. Switch the Language selector to TypeScript and the beautifier uses Prettier’s TypeScript parser, formatting interfaces, type annotations, and generics correctly.
Is my code sent to a server?
No. Both Prettier and Terser run entirely in your browser. Nothing you paste is uploaded or stored — it works even with the network disconnected.
Related tools
Everything runs locally in your browser — your input is never uploaded.