Skip to content
MixTool

JavaScript minifier

Shrink JavaScript for production with the same engine used by webpack, Vite and Next.js.

  • Runs entirely in your browser
  • Free · no sign-up
  • Works on phone and desktop
Loading tool…

Production-ready JavaScript

The minifier runs your code through Terser, the industry-standard JavaScript compressor. It removes whitespace and comments, mangles local variable names to single letters, and compresses the code by folding constants, removing unreachable branches and simplifying expressions — often cutting size by half or more.

You control the trade-offs: turn mangling off to keep names readable in stack traces, and keep /*! license */ comments to stay compliant with open-source licenses. Syntax errors are reported with their location, and the stats compare raw and gzipped sizes.

How to minify JavaScript

  1. 1

    Paste your code

    A script, module or snippet.

  2. 2

    Choose the options

    Compress, mangle names and keep license comments.

  3. 3

    Review the size saving

    Raw and gzipped.

  4. 4

    Copy or download

    Use the .min.js file.

Key features

  • Powered by Terser

    The minifier behind most modern build tools.

  • Dead-code removal

    Unreachable code and unused expressions are dropped.

  • License-friendly

    Keep /*! … */ comments.

  • Local and private

    Your source code isn't uploaded.

Common uses

  • Small sites without a build step: Minify scripts before uploading.
  • Bookmarklets and embeds: Keep snippets as short as possible.
  • Checking bundle wins: See how much a refactor reduces size.

Tips and good to know

Frequently asked questions

Will minified code behave the same?

Yes. Terser only makes changes that preserve behavior. Code that depends on function names at runtime (for example some dependency-injection setups) should be minified with mangling turned off.

Does it support ES modules and modern syntax?

Yes. Classes, async/await, optional chaining, import and export are all supported.

Is my code sent to a server?

No. Terser runs in your browser.