Skip to content
All tools›Minifiers / Beautifiers›JavaScript Minifier

JavaScript Minifier

Compresses JavaScript with no side-effects: removes whitespace and comments while keeping the code semantics intact.

Loading tool...

About the JavaScript minifier

Minification shrinks a script without changing what it does. This tool runs Terser, the compressor used by most build tools (webpack, Rollup, Vite...), entirely in your browser.

What the minifier does

  • Whitespace and comments are removed.
  • Mangling renames local variables to one- or two-letter names.
  • Compression rewrites code into equivalent but shorter form: folds constants, removes unreachable code, inlines single-use functions.
  • License comments starting with /*! or containing @license can be kept.

Options

Option Effect
ECMAScript target Which syntax the output may use.
Mangle local variable names Renames local identifiers (biggest saving).
Compress Applies compression passes.
Keep license comments Keeps /*! */, @license, @preserve.
Treat as ES module Parses import/export and assumes strict mode.
---