JS Minifier
A free JavaScript minifier. Paste your code or upload a .js file and minify JavaScript online in three levels, from light cleanup to full mangling. See the exact size saved, then copy or download the .min.js. No signup, nothing uploaded.
How to minify JavaScript
Add Your Code
Paste your JavaScript into the box, or switch to the upload tab and drop in a .js file.
Pick A Level
Choose Light to strip comments and spacing, Standard to also shorten code, or Maximum to also rename variables for the smallest output.
Copy Or Download
The minified code appears below with the size saved. Copy it or download a .min.js file.
Minify JavaScript Online, Smaller Files, Faster Pages
This JavaScript minifier shrinks your code by stripping out everything a browser does not need to run it: comments, line breaks, indentation, and extra spaces. The result is a smaller .js file that downloads and parses faster, which is one of the easiest wins for page speed and Core Web Vitals. Paste your code or upload a file, and the minified output appears instantly, with the exact bytes saved.
Why minify JavaScript?
Smaller scripts mean less to download and less for the browser to parse before your page becomes interactive. On a typical file you save 30 to 60 percent, and up to 80 percent on well-commented code. That cuts bandwidth, speeds up load time, and helps mobile visitors on slow connections most.
Three levels of minification
Pick how far to go. Light removes comments and whitespace only, so the code stays readable enough to debug. Standard also compresses expressions and dead code for a smaller file. Maximum adds name mangling, renaming local variables to single letters for the smallest possible output. License banners marked with a bang comment are always kept.
Minify vs compress vs obfuscate
Minifying rewrites your code to be smaller while doing exactly the same thing. Gzip or Brotli compression is a separate server step that shrinks the file further in transit, use both together. Obfuscation is different again: it scrambles code to make it hard to read, which is not the goal here. This tool minifies, so your output stays valid, working JavaScript.
Will it break my code?
No, when your input is valid. The tool uses a real JavaScript parser, so it understands your code rather than blindly deleting characters, and it flags a syntax error instead of producing broken output. Everything runs in your browser, so nothing is uploaded. Always test the minified file once before shipping to production.
Why Use This JavaScript Minifier
Real Minification
Built on a proper JavaScript parser, not a find-and-replace, so it safely compresses code and reports a syntax error instead of breaking it.
Three Levels
Light, Standard, or Maximum. Choose readable cleanup, full compression, or aggressive name mangling for the smallest file.
See the Savings
Every run shows the original size, the minified size, and the exact percent and bytes saved, so you know the gain.
Paste or Upload
Type or paste your JavaScript, or drop a .js file up to 5 MB. Line numbers and syntax-safe output on both sides.
Copy or Save
Copy the minified code with one click or download it as a ready-to-ship .min.js file.
Private and Free
Everything runs in your browser. Your code is never uploaded, and there is no sign-up or limit.
Similar Tools
More Developer tools you might find useful.
Frequently Asked Questions
Common questions about minifying JavaScript.
How do I minify JavaScript online?
Paste your code or upload a .js file, choose a minify level, and the minified output appears instantly. Then copy it or download the .min.js. It is free, runs in your browser, and nothing is uploaded.
What does minifying JavaScript do?
It removes characters a browser does not need, comments, whitespace, and line breaks, and can compress expressions and rename variables. The code does exactly the same thing but in a smaller file that loads and parses faster.
What is the difference between the levels?
Light strips comments and whitespace only. Standard also compresses expressions and removes dead code. Maximum adds name mangling, renaming local variables to single letters for the smallest output.
Will minifying break my code?
No, if your input is valid JavaScript. The tool parses the code properly and reports a syntax error rather than producing broken output. Test the minified file once before deploying, as a habit.
What is the difference between minify and gzip?
Minifying rewrites the source to be smaller. Gzip or Brotli compresses the file in transit at the server. They stack: minify first, then let your server gzip, for the smallest possible download.
Does minify mean the same as Terser or UglifyJS?
Terser and UglifyJS are minifier engines. This tool minifies with a modern, ES6+ compatible engine, so it handles current JavaScript syntax that older UglifyJS cannot.
Is there a file size limit?
You can paste any amount of code, and uploaded .js files are supported up to 5 MB. Everything is processed on your device.
Is this JavaScript minifier free?
Yes, completely free with no sign-up and no limits. Minify as many files as you like.