JavaScript Minifier
NEWPaste your JavaScript code to minify it instantly. Removes comments, collapses whitespace, strips console.log and debugger statements.
More options
How to use JavaScript Minifier
- Paste your JavaScript code into the input field.
- Toggle options for console.log and debugger removal.
- Click Minify JS.
- Copy the minified code and view compression stats.
What is JavaScript Minifier?
This JavaScript minifier reduces code size by removing single-line and multi-line comments (preserving URLs), collapsing whitespace, and optionally removing console.* calls and debugger statements.
Shows before/after character counts with percentage reduction. Note: for production minification with variable mangling, use tools like Terser or esbuild.
FAQ
- Is this as good as Terser/UglifyJS?
- This tool handles basic minification (comments, whitespace, console removal). For production use with variable mangling and tree-shaking, dedicated tools like Terser are recommended.
- Does it preserve URLs in comments?
- Yes — single-line comments containing '://' are preserved since they're likely URLs, not code comments.
Related tools
Last updated: