JavaScript Minifier (Basic)
Strip comments and blank lines from JavaScript for a smaller file.
Paste JavaScript to remove comments and blank lines. This is a conservative, basic minifier — it does not rename variables, collapse whitespace inside lines, or apply the deeper optimizations a full build-tool minifier like Terser would, precisely to avoid the risk of subtly breaking your code.
Your files and text are processed locally in your browser — nothing is uploaded to a server.
JavaScript Minifier tool
How to Use JavaScript Minifier
- Paste your JavaScript.
- Click Minify.
- Review and copy the result.
Features
- Removes // and /* */ comments safely (string- and template-literal-aware)
- Strips blank lines
- Shows size reduction
- Never renames variables or reorders code
Frequently Asked Questions
Why doesn't this shrink my file as much as Terser or UglifyJS?
Those tools parse a full syntax tree and can safely rename variables and restructure code; this tool intentionally only removes comments and blank lines to avoid any risk of breaking your script.
Is it safe to use the output in production?
The transformations are conservative, but always test minified output before deploying it.