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: step by step
- Choose Full (smallest, using Terser) or Safe (comments and blank lines only).
- Paste your JavaScript.
- Copy the minified result.
- Test the page that uses it.
A real example
A 30 KB tracking script with many comments goes onto every page. Full mode renames local variables and removes spaces, making it much smaller; Safe mode just tidies it while keeping every line.
Tips for better results
- Use Safe mode if your code relies on function names or you need readable line numbers in errors.
- Terser loads the first time you use Full mode.
- For production sites, a bundler with Terser or esbuild is the best long-term setup.
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.