JS MINIFIER

Compress JavaScript instantly in your browser — removes whitespace and comments. Your code never leaves your device. Paste or upload, minify, download.

Rate this tool
Complete the verification above to enable the minifier.

What Gets Removed

Always Removed

  • Single-line comments // ...
  • Block comments /* ... */
  • All whitespace & newlines
  • Spaces around { } ( ) ; , =
  • Tabs & indentation

Always Preserved

  • All variable & function names
  • All string & template literals
  • Regular expressions
  • Arrow functions & classes
  • All program logic & operators

Typical Savings

  • jQuery 3.x: ~35%
  • React dev build: ~40%
  • Custom ES6 module: 20–70%
  • Heavy comments: up to 70%
  • Lean scripts: 10–20%

After Minifying

Combine with gzip or Brotli on your server for maximum transfer savings. Add a content hash to the filename for cache-busting. Reference directly in HTML.

<script src="app.min.js"></script>

Frequently Asked Questions

What does JavaScript minification do?
JavaScript minification removes all characters the browser doesn't need to execute the code — whitespace, newlines, comments, and unnecessary spaces around operators. The output is functionally identical to the input but smaller and faster to download and parse.
How much can minification reduce JS file size?
Typically 20–70% depending on whitespace and comment density. A heavily-commented codebase can shrink 50–70%. Production bundles with little whitespace may only see 10–20% savings. Always combine with gzip or Brotli for maximum transfer savings.
Is my JavaScript code sent to your servers?
No. All processing happens entirely in your browser using JavaScript regex. Your code never leaves your device and is never transmitted to any server. Your proprietary code is completely private.
What exactly gets removed during JS minification?
Removed: single-line comments (//), block comments (/* */), all unnecessary whitespace and newlines, spaces around operators, brackets, commas, and semicolons. Preserved: all variable names, function logic, string contents, regular expressions, and every functional statement.
What JavaScript syntax does this minifier support?
This minifier handles modern ES6+ including arrow functions (=>), template literals, classes, destructuring, spread operators, and async/await. It performs safe whitespace and comment removal without altering logic or variable names. It is a non-destructive minifier — no mangling or renaming.
What filename format does the download use?
The file downloads as [your-filename].min.js, preserving the original uploaded filename stem. For example, uploading app.js gives app.min.js. If you pasted code directly without uploading, it defaults to script.min.js.
Is there a file size limit?
Yes — 2MB maximum. jQuery unminified is around 290KB, React development build around 1.1MB — both within the limit. For very large bundled files, split into modules and minify separately.
Can minified JS go directly into production?
Yes. The output is production-ready. All logic is intact. Download the .min.js file, reference it with a <script> tag, and enable gzip or Brotli on your web server for additional transport savings.