JavaScript Minifier
Remove comments and whitespace from JavaScript.
This minifier only removes comments and extra whitespace. It does not rename variables or rewrite code, so the output behaves exactly like the input. Line breaks are kept where removing them could change how JavaScript reads the code.
About this tool
JavaScript Minifier removes comments and unneeded whitespace from scripts. It does not rename variables or rewrite code, which keeps it safe for quick jobs. For full minification in a build, use a tool like Terser or esbuild.
How to use JavaScript Minifier
- Paste your JavaScript.
- Press “Minify”.
- Copy or download the result.
Questions people ask
Why are some line breaks kept?
JavaScript inserts semicolons automatically at some line breaks. Where removing a line break could change the meaning, the minifier keeps it.
How is this different from Terser or UglifyJS?
Those tools also rename variables and remove dead code, often shrinking files by 50% or more. This tool only strips comments and whitespace, typically 20% to 40%.
Are licence comments kept?
Yes. Block comments that start with /*! are kept.