Skip to content
HB HitBidder.com
Developer Tools

JavaScript Minifier

Reduce JavaScript size with safe whitespace and comment removal.

Free No signup Runs in your browser
Tool workspace

JavaScript Minifier

Ready to use

Minify JavaScript

Terser parses, compacts and optionally compresses your code — never executes it.

0 characters

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

It uses Terser, a mature JavaScript parser and minifier. The default mode disables compression and mangling, so it only removes comments and unnecessary whitespace. Always test the minified file before deploying.

No. Terser parses the source into an abstract syntax tree and prints it back. The JavaScript Tools page never runs the code you paste.

It enables Terser compression and identifier mangling. That can rename variables and functions and remove code Terser considers dead. It usually produces much smaller output, but review it carefully, especially for code using reflection or function names.

The Terser browser bundle is about 1 MB. It is served locally and only downloaded the first time you select Minify, so the rest of the tools section stays lightweight.

ES modules are supported when the ES module option is enabled. TypeScript and JSX must be transpiled first; Terser parses JavaScript, not TypeScript or JSX syntax.

No. The Terser bundle and your code stay in the browser. Nothing is sent to HitBidder, logged or stored.
Beyond the toolbox

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.