JavaScript Minifier
Minify JavaScript with Terser to reduce file size.
Runs entirely in your browser — your input never leaves your deviceAbout this tool
This minifier runs Terser — the industry-standard JavaScript compressor — directly in your browser. It removes whitespace and comments, shortens variable names (mangling) and applies safe compression, then reports how many bytes you saved.
Use it for quick one-off minification of a snippet or a small script. Because it uses a real parser rather than regex, it won't silently break valid code.
Why use it
Real Terser
Compresses and mangles with the industry-standard minifier.
Safe
Parses an AST rather than using regex, so valid code won't break.
Size report
Reports the bytes saved.
Common use cases
- Minify a script or snippet
- Shrink a small library before shipping
- Compress inline JavaScript
- Compare original vs minified size
Frequently asked questions
What does minifying do?
It removes whitespace and comments and shortens local names so the file downloads faster, without changing what the code does.
Is Terser safe?
Yes — Terser parses your code into an AST and transforms it correctly, which is far safer than regex-based minifiers that can corrupt valid JavaScript.
Is my code uploaded?
No. Terser is loaded and run entirely in your browser; your code never leaves your device.
Does it support modern JavaScript?
Yes, Terser handles modern ES syntax. For very large bundles, use a build tool — this is best for snippets and small scripts.