JavaScript Minifier

Compress JavaScript code for production.

Runs entirely in your browser — nothing is uploaded

Removes comments and unnecessary whitespace only — variables and functions are never renamed, so the code behaves exactly as before. Strings, template literals and regular expressions are left untouched. Everything runs in your browser; your code is never uploaded.

Minify JavaScript Online — Free JS Minifier

Shrink your JavaScript for production by removing the comments and extra whitespace that browsers don't need. Paste your code or upload a file, click Minify, and see exactly how many bytes you saved.

How to Minify JavaScript

Paste your code into the input box — or use Upload .js file — and click Minify JavaScript (Ctrl or Cmd + Enter works too). The compressed code appears in the result box along with the original size, the minified size, the percentage saved, and an estimate of the size once gzip-compressed, which is closer to what visitors actually download. Copy the result, or download it as a .min.js file named after your original.

What Gets Removed — and What Doesn't

The minifier strips comments, line breaks, and indentation, and keeps a line break only where removing it could change how the code runs, such as in scripts written without semicolons. Strings, template literals, and regular expressions are left exactly as written. It doesn't rename your variables or functions, so the code behaves the same as before — the trade-off is that the file won't get as small as it would with a full build tool that also shortens names.

License notices such as /*! ... */ comments, or ones marked @license or @preserve, are kept by default, and you can untick the option to remove them too. If your code has an unterminated string, comment, or template literal, the tool tells you which line to look at, and it warns you if the brackets don't balance. As with any minifier, give the output a quick test before you deploy it.

Good Uses for This Tool

Compressing a small script or bookmarklet, trimming a snippet before you inline it in a page or an email template, checking roughly how much a file would shrink before you set up a build step, and producing a quick .min.js file when you don't have a bundler handy.

Is It Actually Private?

Yes. Minifying happens entirely in your browser — your code is never uploaded to a server and is not stored anywhere, so it's safe to use with unreleased or proprietary scripts.

Frequently Asked Questions

Is JavaScript Minifier free?

Yes, completely free with no signup required.

Is my data uploaded anywhere?

No. This tool runs entirely in your browser — your data never leaves your device.

Related searches

javascript minifier online minify js compress javascript reduce js file size js minifier for production shrink javascript code

Get new tools first

One short email when we ship something new. No spam, unsubscribe anytime.