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.
This JavaScript can’t be parsed
How it works
-
Paste your script
Paste JavaScript or open a .js file. Modern syntax is supported, including classes, async functions and optional chaining.
-
Tune the options
Keep the defaults for a safe, small result, or remove console calls, shorten top-level names and run extra passes.
-
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.