Minify JavaScript Online — Free JS Minifier
Minify JavaScript code instantly with our free online tool. Compress JS for production, reduce file size, or concatenate multiple files. All processing happens in your browser — no code sent to any server.
Features
Reduce the size of your JavaScript code by removing spaces, comments and unnecessary characters.
Reduce the size of your JavaScript code by removing spaces, comments and unnecessary characters.
Package used
Terser is a modern JavaScript compressor that optimizes the size and performance of your code.
Minification options
Examples by ECMAScript version:
Original code (ES2022)
ES2022
ES5
Compression examples:
Original code
Conservative
Normal
Aggressive
Comparison with/without option:
Original code
With preserveClassNames: true
With preserveClassNames: false
Difference
Comparison with/without option:
Original code
With preserveFunctionNames: true
With preserveFunctionNames: false
Difference
Comparison with/without option:
Original code
With removeConsole: true
With removeConsole: false
Difference
Comparison with/without option:
Original code
With removeDebugger: true
With removeDebugger: false
Difference
How to Unminify JavaScript Online
JavaScript Beautifier vs Unminifier — What's the Difference
Concatenating JavaScript Files
Combining multiple JavaScript files into one reduces HTTP requests and can improve page load performance. Use our concatenation feature to merge multiple JS files, then optionally minify the result for maximum compression. This is especially useful for projects that don't use a bundler like Webpack or Rollup.
Frequently Asked Questions — Minify
Everything about minification
Why minify JavaScript?
JavaScript minification reduces file sizes by removing whitespace, comments and shortening variable names. Typical size reductions range from 30% to 70%.
How does JavaScript minification work?
Our tool uses Terser, the industry-standard JavaScript compressor. It removes unnecessary characters while optionally mangling variable names. The minified code is functionally identical to the original.
Need to unminify JavaScript?
Use our dedicated JavaScript unminifier to restore readable formatting from minified code.
Need to beautify JavaScript?
Use our JavaScript beautifier to format code with consistent indentation.
Is my code processed securely?
All JavaScript processing happens entirely in your browser. No code is sent to any server.
Can I concatenate JavaScript files?
Yes, use our concatenation feature to merge multiple files, then minify the combined result for maximum compression.
Looking for converters, encoders, formatters, and minifiers in one place? Developer tools hub Open the curated developer tools catalogue.