JavaScript Minifier
Paste 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
People also use
- CSS Minifier🗄️ Developer Tools
Minify CSS code online. Remove comments, whitespace, and unnecessary characters to reduce file size. Free CSS minifier — instant results.
- HTML Minifier🗄️ Developer Tools
Minify HTML code online. Remove comments, collapse whitespace, and reduce file size. Free HTML minifier — instant results in your browser.
- JSON to TypeScript🗄️ Developer Tools
JSON to TypeScript — Paste a JSON payload and instantly get TypeScript interfaces (or type aliases) describing its shape. Optionally mark all properties...
Last updated: