Home › JS Minifier / Beautifier — Free Online Tool | Wgajaa
JS JS Minifier / Beautifier
Compress or pretty-print JavaScript. Free, private and instant — nothing you enter is sent anywhere.
About this tool
Wgajaa's JS minifier and beautifier handles the two everyday JavaScript chores in one place: compress a script for production or pretty-print one you have to read. Paste code, pick a mode, and the transformed output appears instantly.
Beautify re-indents statements and blocks with your chosen width so control flow is readable. Minify removes comments and collapses whitespace between tokens — a conservative pass that never renames variables, so the output stays behaviorally identical. Everything runs locally; your code never leaves the tab.
How this tool works
Everything runs locally in your browser — no data is sent to any server. Here is exactly how it works:
- Paste your JavaScript into the left textarea
- Pick Beautify to pretty-print or Minify to compress
- Choose an indentation width — it applies when beautifying
- Copy the transformed code with one click
Frequently Asked Questions
The minifier only removes comments and non-essential whitespace; it never renames identifiers or restructures code, so behavior is preserved. For maximum compression with mangling, use a build tool — this tool is the quick, zero-risk pass.
It re-indents statements inside braces to your chosen depth and puts each statement on its own line. Strings and comments inside strings are respected, so code like "a;b" is never split incorrectly.
Template literals are treated as strings and preserved exactly. Regular expressions are handled reasonably in common cases, but heavily ambiguous input is why you should always review the output before shipping it.
Without variable renaming and dead-code elimination there is a floor to compression — typically 15–30% for readable source. Most of the savings come from comments, indentation and line breaks.
No. Both transforms run locally in your tab with plain JavaScript. Nothing is transmitted or stored.