Aggressively compress JavaScript by removing whitespace and shortening identifiers. Reduces bundle size for production deployments without breaking logic.
Key Features
Removes all comments, blank lines, and unnecessary formatting spaces
Optimises syntax tokens without altering execution semantics
Shows real-time byte compression ratio and payload savings
Safe parsing that respects automatic semicolon insertion rules
How to Use
Paste your JavaScript source code into the editor.
Click "Minify JS" to run the compression.
Review the minified one-line output and compression metrics.
Copy the minified code for deployment to your CDN or web server.
Example
Sample input
function greet(name) {
return 'Hello, ' + name;
}
Sample output
function greet(name){return'Hello, '+name}
Edge Cases
Already minified one-liners
Regular expressions with slash characters
Copyright comments at file top
Frequently Asked Questions
Does minification alter how my JavaScript executes?
No. The minifier only removes whitespace, newlines, and comments that the browser JavaScript engine ignores anyway. Functional logic remains identical.
Can minification break code if semicolons are missing?
The compressor takes ASI (Automatic Semicolon Insertion) rules into account to ensure statements are properly delimited before lines are joined.
How much size reduction should I expect?
Standard human-written JavaScript typically shrinks by 30% to 60% depending on the volume of comments and whitespace.
Privacy notice: when you run this tool, your input is sent over HTTPS to our server, processed in memory and returned. It is not stored or logged. Avoid pasting live secrets such as private keys or passwords.