🔧 Utility

JavaScript Minifier Online Free

Minify and compress JavaScript code instantly in your browser. Remove comments, whitespace and shorten variable names. Shows exact bytes saved. No upload required.

Minification Options
📝 Original JavaScript
⚡ Minified Output

About JavaScript Minifier

JavaScript minification reduces the size of your JS files by removing all unnecessary characters — comments, extra whitespace, newlines — without changing functionality. Smaller JS files load faster, improving your website's performance and Core Web Vitals score.

What gets removed: Single-line comments (//), multi-line comments (/* */), extra spaces, tabs, and newlines. The optional "Shorten variable names" option renames local variables to single characters (a, b, c…) for maximum compression.

Note: This tool performs safe, basic minification. For production use with advanced optimisations (tree shaking, dead code elimination), use tools like Terser or webpack in your build pipeline.

Updated: May 2025 · Works on Chrome, Firefox, Safari, Edge · Mobile friendly

Frequently Asked Questions

Will minification break my code?+
Basic minification (removing comments and whitespace) never breaks code. Shortening variable names can occasionally cause issues with code that relies on variable names — test minified code before deploying.
How much will minification reduce my JS size?+
Typically 20-50% for well-commented code. Libraries like jQuery see 30-40% reduction. Combined with gzip compression on your server, total transfer size can be 60-80% smaller.
What is the difference between minification and obfuscation?+
Minification removes whitespace/comments to reduce size. Obfuscation deliberately renames variables and restructures code to make it hard to read — primarily for protecting intellectual property.
Can I minify TypeScript with this tool?+
This tool works on standard JavaScript. TypeScript (.ts files) should first be compiled to JavaScript, then minified. The output JavaScript from TypeScript compilation works perfectly here.
Done!