JavaScript Minifier
Full mode uses Terser, the standard professional minifier, for the smallest possible file. Safe mode only strips comments and blank lines, keeping every line intact.
Want maximum compression instead?
For production sites, a real bundler-based minifier (Terser, esbuild, SWC) will get files much smaller and is what we'd actually recommend for a live site's core bundle. This tool is for quick one-off shrinking — pasting a snippet before adding it to a CMS text box, for example — where installing a build tool isn't worth it.
How to use the JavaScript Minifier
- Paste your JavaScript.
- Use Full minification for the smallest file, or Safe mode to only strip comments and blank lines.
- Copy the result and test it before publishing.
Frequently asked questions
What is the difference between Safe and Full?
Safe mode only removes comments and blank lines, so line structure stays intact. Full mode uses Terser, the industry-standard minifier, to rename variables and remove all unneeded characters.
Is my code uploaded?
No. Both modes run in your browser. Terser is downloaded from a public CDN the first time you use Full mode.
Why did Full mode show an error?
Terser needs valid JavaScript. The error points to the line with a syntax problem.