JavaScript Minifier
Reduce JavaScript size with safe whitespace and comment removal.
JavaScript Minifier
The Terser bundle is downloaded only when you first select Minify. Default mode only removes comments and whitespace; aggressive mode can rename identifiers.
JavaScript minification with a real parser
The HitBidder JavaScript Minifier uses Terser, a mature JavaScript parser and minifier, instead of fragile regular expressions. It understands strings, template literals, regular expressions, comments, automatic semicolon insertion and modern syntax, so it does not corrupt code the way a simple text replacement can.
The default mode disables compression and mangling: it removes comments and unnecessary whitespace while leaving your identifiers and logic intact. The result is smaller and still easy to map back to the source.
Conservative vs aggressive mode
Conservative mode is the safer default. Aggressive mode enables Terser's compressor and identifier mangler: it can shorten names, fold constants and remove code it considers dead. That produces much smaller output, but it can affect code that relies on function or class names, reflection, string-based lookups or subtle dead-code assumptions. Always test aggressive output.
Keep /*! … */ license comments enabled when attribution matters. ES modules with
import and export need the ES module option.
Why Terser is loaded on demand
The Terser browser bundle is about 1 MB. Loading it on every tools page would slow down unrelated tools, so it is fetched from the local vendor directory only when you first select Minify. Your browser caches it for subsequent runs.
What it does not do
- It does not execute the code; Terser parses and prints.
- It does not transpile TypeScript, JSX or newer syntax to older targets. Transpile first.
- It does not resolve imports or bundle modules; use a bundler for that.
- It does not guarantee that aggressive compression is safe for reflection-heavy code.
Privacy and correctness
Your source stays in the browser. The Terser bundle is served locally, no code is uploaded or logged, and the output is produced from the parsed syntax tree. For critical production bundles, keep a source map and run your normal test suite against the minified artifact.
JavaScript minifier FAQ
Tools get you ready. Real traffic gets you results.
HitBidder is a free 1:1 traffic exchange. Give a click, get a click, and send real visitors to the pages you just finished optimising.