JavaScript Minifier
Paste JavaScript and get a minified version with mangled local names and compressed logic, plus the size saved.
Minified
Paste code to minify it.
About this tool
Terser is the minifier behind most bundlers. It parses the code, removes dead branches and unused variables, folds constants, rewrites expressions into shorter equivalents and renames local variables to single letters. Public names — exports, globals, object properties — are kept so the code keeps working.
Use it for bookmarklets, inline scripts in HTML pages, userscripts and quick size checks. The output is standard JavaScript; modern syntax is preserved rather than transpiled. Everything runs in your browser and nothing is uploaded.
Frequently asked questions
- Why do I get a syntax error?
- The input must be valid JavaScript. TypeScript, JSX and Flow are not accepted; compile them first.
- Will my function names change?
- Top-level names are kept; only local variables and parameters inside functions are renamed.
- Does it produce a source map?
- Not here. Use Terser in your build pipeline when you need source maps.