JavaScript minifier

Paste JavaScript to get a smaller file that behaves the same, with the size you save before and after gzip.

Sealed on this device

Runs in your browser. Nothing is uploaded.

Sealed

Minified JavaScript

Your minified JavaScript will appear here as you type.

How it works

  1. Paste your script

    Paste JavaScript or open a .js file. Modern syntax is supported, including classes, async functions and optional chaining.

  2. Tune the options

    Keep the defaults for a safe, small result, or remove console calls, shorten top-level names and run extra passes.

  3. Copy the result

    Check the bytes saved, then copy the code or download a .min.js file.

Frequently asked questions

Is my code uploaded?

No. Terser, the minifier used by most JavaScript build tools, runs inside your browser. Your source code never leaves your device.

Will the minified code behave the same way?

Yes, with the default options. Code that relies on function names at runtime, for example for error reporting, should use “Keep function and class names”. Including top-level names is only safe when the script doesn’t share global variables with other scripts.

What does “Output syntax” change?

It tells Terser which JavaScript version it may use when rewriting your code, such as arrow functions in ES2015 or newer. It doesn’t convert modern syntax down to ES5: use a transpiler such as Babel for that.

Why turn on “ES module”?

Files that use import or export are modules. Telling Terser lets it parse them, apply strict mode and safely shorten top-level names, since a module’s variables aren’t global.

Does it create a source map?

No. This tool is meant for quick minification. For production builds with source maps, use Terser through your bundler.

Install One For All on your computer

One For All then opens in its own window, like an app, straight from your desktop or home screen. Nothing to download from a store, and your files still stay on your device.

  1. Click the install icon at the right of the address bar, or open the browser menu (⋮).
  2. Choose “Install One For All” or “Install page as app”: a shortcut is added to your desktop and your apps.

Download this tool’s engine?

This tool works entirely in your browser. To do that, it needs to download the items below from One For All, just once. They are then kept on this device, so next time the tool starts right away.

Your files are never sent anywhere.