Compress and minify JavaScript with Terser. Removes whitespace, mangles variables, eliminates dead code. ES2022+ support. Shows compression ratio. Browser-based.
The JavaScript Minifier compresses JavaScript files using Terser — the most capable open-source JavaScript minifier and compressor. With `compress: true` and `mangle: true`, Terser performs dead code elimination, constant folding, inline expansion, and hexadecimal identifier renaming, producing the smallest valid JavaScript output. Real-time compression ratio and exact byte savings are displayed after each run. The output panel has line-wrap enabled for compact output, and a download button lets you save the minified file directly. All processing runs in a Web Worker; your code never leaves the browser.
QWhich JavaScript minifier does this use?
Terser — with both compress (dead code elimination, constant folding) and mangle (identifier renaming) enabled. Terser is the successor to UglifyJS and the most widely used JavaScript minifier in production.
QWill minification break my code?
Terser's compression is safe for standard JavaScript. Code that relies on function.name, Function.prototype.toString(), or uses string-based property access (bracket notation with dynamic keys) should be tested after minification.
QIs my code sent to a server?
No. Terser runs in a Web Worker entirely inside your browser. Nothing is transmitted to any server.
QWhat is the difference between the JavaScript Minifier and the JavaScript Obfuscator?
The minifier reduces file size through whitespace removal and variable renaming. The obfuscator adds additional transformations (control flow flattening, string encoding, dead code injection) specifically to deter reverse engineering, at the cost of larger output.