# JavaScript Minifier

> Minify JS with Terser and see gzip savings. Runs entirely in your browser — nothing is uploaded.

Source: https://toffeekit.com/tools/javascript-minifier

**Category:** [Developer](https://toffeekit.com/category/developer) · **Price:** Free · **Runs:** in your browser, nothing is uploaded

Open the tool: https://toffeekit.com/tools/javascript-minifier

**Also useful for:** minify, js, terser, uglify, compress, gzip, mangle, bundle size

## How it works

1. Paste your JavaScript into the JavaScript box, or click Sample.
2. Choose options such as Mangle names, Compress, Drop console.* calls and the ES target.
3. Check the original, minified and gzipped sizes and the percentage saved.
4. Click Copy or Save to download script.min.js.

## FAQ

### How do I minify JavaScript online?

Paste the code and the minified version appears on the right. The size cards show how much smaller it is, both raw and gzipped.

### What does Mangle names do?

It shortens local variable and function names, such as userCount to a, which cuts file size. Turn on Keep function & class names if your code depends on them, for example in stack traces.

### How do I remove console.log from my code?

Turn on Drop console.* calls. Terser then removes calls to console.log and the other console methods from the output.

### Why do I get a syntax error?

The code has a parse problem, and the message shows the line and column with a pointer to it. If you are minifying plain scripts that use import or export, keep ES module switched on.

### Which ES version should I choose?

Pick the oldest version your users need. ES2020 is a safe modern default, while ES5 avoids modern syntax for very old browsers. Terser does not convert newer syntax downward.

### Is JavaScript Minifier free and private?

Yes. It's free with no sign-up or limits, and it runs entirely in your browser, so what you type or paste never leaves your device. It works on phones and computers alike.

## Privacy

JavaScript Minifier runs entirely in your browser. Your files and text are processed on your device and are never uploaded.

## Related tools

- [JSON Formatter](https://toffeekit.com/tools/json-formatter) — Format, minify and validate JSON with clear errors.
- [Base64 Encode / Decode](https://toffeekit.com/tools/base64-encoder) — Encode text to Base64 or decode it back, UTF-8 safe.
- [URL Encode / Decode](https://toffeekit.com/tools/url-encoder) — Percent-encode query values or whole URLs.
- [HTML Entities](https://toffeekit.com/tools/html-entity-encoder) — Escape < > & and quotes, or decode entities.
- [JWT Decoder](https://toffeekit.com/tools/jwt-decoder) — Read a token's header, claims and expiry.
- [Hash Generator](https://toffeekit.com/tools/hash-generator) — MD5, SHA-1, SHA-256, SHA-384 and SHA-512 at once.

