Free Developer Tool

JavaScript Minifier: Minify JS Code Online

Paste your JavaScript, click once and get a smaller file that does exactly the same thing. Strips comments, spaces and line breaks. Free, instant, no signup.

Remove comments Remove whitespace Shorten variables Show size saved Copy in one click Download .min.js No signup

Smaller JavaScript, Faster Pages

Every comment, space and line break in your JavaScript gets downloaded by every visitor. On a big script, that adds up to real seconds on a slow mobile connection. This JavaScript minifier strips the extras out so your files are lighter, your pages load quicker and Core Web Vitals look a little better.

Read more

Minify JS in One Click

Paste your code and click Minify JS. Comments, indentation and blank lines are removed and the result appears instantly, along with how much space you saved. Copy it or download it as a .min.js file.

Why Minified JavaScript Loads Faster

Smaller files download and parse faster, especially on phones. Minified JavaScript combined with Gzip or Brotli on your server can cut transfer size a lot. Google’s PageSpeed Insights even flags unminified JS as an easy win. Run a JavaScript minify step before every deploy and you’ll rarely see that warning.

Shorter Names, Same Behaviour

Turn on name shortening and local variables like userAccountBalance become a or b. The JS minifier only renames things that are safe to rename, so global names and object properties your other code relies on stay untouched.

JavaScript Minify Online or in Your Build

Big projects usually minify with Terser, esbuild or a bundler like Vite. But for a WordPress snippet, a landing page script or a quick fix, it’s faster to minify JS online here. No setup, no node_modules folder. A quick JS minify online pass is often all a small script needs.

Keep License Comments if You Need To

Many open-source libraries ask you to keep their licence notice. Comments starting with /*! can be preserved while everything else is stripped, so you stay compliant while still minifying JavaScript properly.

Need to Un-Minify JS Later?

Minified code isn’t meant to be edited. Keep your original file for that. If all you have is the minified version, paste it into our JavaScript Beautifier to unminify it and restore readable formatting.

How to Minify JavaScript

1

Paste your JavaScript

Copy your code into the input box. Click Sample to see a before-and-after example.
2

Pick your options

Keep comment removal on. Turn on name shortening for extra savings, and keep licence comments if your code includes a library.
3

Click Minify JS

The minifier compresses your code and shows the original size, new size and percentage saved.
4

Copy or download

Click Copy or Download to get your .min.js file. Link to it in place of the full version on your live site.

JavaScript Minifier FAQs

Common questions about minifying JS code.

What does it mean to minify JS?

To minify JS means removing everything the browser doesn’t need: comments, extra spaces, line breaks and sometimes long variable names. The code works the same but takes up less space.

How to minify JavaScript?

Paste your code into the tool above and click Minify JS. In a project, you can add Terser or esbuild to your build. For one file, the online tool is quickest. That’s how to minify JavaScript without any setup.

How much smaller will my file get?

It depends on how many comments and how much whitespace the original has. Heavily commented code shrinks a lot more than code that’s already compact. The tool shows you the exact savings.

Does minifying JavaScript change how it works?

It shouldn’t. Good minifiers only remove things that don’t affect behaviour. If your code relies on function names at runtime, turn off name shortening and test after minifying.

What’s the difference between minify.js and .min.js?

There’s no special file called minify.js. The convention is to name minified files with .min.js, like app.min.js, so you can tell them apart from the readable source.

Should I minify JS if my server uses Gzip?

Yes. Minification and compression work together. Minifying removes characters; Gzip or Brotli then compresses what’s left. You get the smallest file by doing both.

Can I un minify JS?

You can restore the formatting with our JavaScript Beautifier, but stripped comments and original variable names can’t be recovered. Always keep your source file.

Is this JavaScript minifier free?

Yes. It’s a free JavaScript minifier online, with no signup and no file limit for normal use.

JS minified? Shrink the rest of your page.

Compress your stylesheets with our CSS Minifier, and trim your markup with the HTML Minifier.

CSS Minifier

Raheel Jakhura

CEO / Co-Founder

Our goal is to provide online free tools so you don't have to install any software for basic usages. We are trying to add more tools and make these tools free forever.

cookies image
We care about your data and would love to use cookies to improve your experience.