JavaScript Minifier
Minify JavaScript with Terser. Mangle variable names and compress for smaller bundles.
Powered by Terser, running entirely in your browser — code never leaves your device.
About JavaScript Minifier
Minify JavaScript using Terser — the same tool used by Webpack and Vite under the hood. Removes whitespace, mangles variable and function names to single characters, and applies dead-code elimination. Shows original vs. minified size and percentage reduction. Code is processed entirely in your browser using the Terser WebAssembly build.
All processing happens entirely in your browser using modern web APIs. Nothing is uploaded to our servers — your data stays local and private. Free to use forever.
Common use cases
- Quickly minifying a JavaScript snippet for embedding in HTML
- Checking how much a JavaScript file can be reduced before bundling
- Minifying userscripts or browser extensions for distribution
- Obfuscating variable names in client-side code
- Comparing minified output between different compression options
How it works
Runs Terser in the browser via its browser-compatible build. Terser parses JavaScript into an AST (Abstract Syntax Tree), applies optimizations (constant folding, dead code elimination, inlining), renames variables to shorter names (mangling), and serializes back to a compact string. The WebAssembly build of Terser runs at near-native speed in the browser.