JavaScript Minifier
Terser in your browser. Live output, per-option control, real byte-savings stats.
How to use
Paste JavaScript into the input pane. The minified output appears on the right as you type (300ms debounce, so it doesn't re-run on every keystroke).
Adjust the options row to control mangling, compression, comment preservation, and ECMAScript target. Copy the output or download as minified.js.
Keyboard shortcuts
Two shortcuts:
| Cmd / Ctrl + K | Focus the input pane |
| Cmd / Ctrl + Enter | Copy output to clipboard |
When to use it
Minification is production shipping. It strips whitespace, shortens variable names, drops comments and dead code, and can remove debugging aids like console.log and debugger.
- Preparing a script for a static site or CDN drop, without setting up a build pipeline.
- Quickly checking how small a snippet gets before wiring it into a bundler.
- Sanity-checking terser's output on a specific piece of code.
- One-off scripts that don't warrant a full build.
When not to use: If you already have a build pipeline (webpack, Rollup, Vite, esbuild), minify there — you'll want source maps and integration into your deploy.
Options
Mangle names — renames variables and function names to short forms (a, b, c, ...) within their scope. Safe by default; can break if your code relies on Function.prototype.name or reflection.
Compress — enables terser's expression-level optimizations: dead code elimination, constant folding, inline simple functions, remove unreachable branches.
Drop console — removes all console.* calls. Only active when Compress is on.
Drop debugger — removes all debugger; statements. Only active when Compress is on.
Comments — None strips every comment. Important keeps /*! */-style banners (license headers). All keeps every comment.
Target — ECMAScript version the output must run on. ES5 for legacy browser support; Latest for modern-only builds.
Format-specific gotchas
Mangling can break code that reads function names. If your code does fn.name === 'handleClick', mangling changes handleClick to something like a. Same for Vue/React devtools that use displayName — pass those through your build unchanged, or disable mangling.
Terser is not a transpiler. Modern syntax stays modern. If you paste in async functions and set target to ES5, terser will not down-compile — you'll get an error or invalid output. Use Babel for down-compilation, then terser to minify.
Long-running scripts may hit the debounce. Minification runs 300ms after your last keystroke. Very large inputs (hundreds of KB) may take a second or two to process on the main thread.
Terser is dynamic-imported on first use. First minify has a small delay while the library loads (~200KB gzipped). Subsequent runs are instant.
Privacy
Everything runs in your browser. Your JavaScript never leaves the page — no server, no logging, no analytics on the content.