Minified JS Code

What is Online JavaScript Minifier?

JavaScript Minifier is a free online tool for minifying and compressing JavaScript code. JavaScript is a scripting language used in web browsers. Its usage is extended in recent years with Node.js but main idea is to manage interactions and data flow in a webpage.

JavaScript code may be written in HTML as inline script within script tags, or it may be added to the page with a link that referencing a .js file. There are many module bundlers which automatically converts the code you wrote into minified JS files like webpack, parcel, rollup or browserify. You need to configure them, and they merge and compress your JS files without any hustle. But, if you have a tiny project which you don't need these module bundlers and you need to minify your JS code by yourself, online JavaScript Minifier will help you a lot.

When you compress Javascript code by minifying them, your file size will be decreased remarkably and it affects positively your webpages loading time and UX (User Experience). There are many configuration options in JS minification, yet this tool uses the defaults to keep things minimalistic.

Here is an image showing how Javascript minification works and how the size is decreasing after compression. It shows before vs. after for minification of a Fibonacci generator function.

Before vs. After JavaScript Minification
Before vs. After JavaScript Minification

After the end of minification process, a green box will be showed up that shows compression percentage if the code has not been minified already. Keep in mind that a warning will be showed if there is a validation problem with the JS code.

How to use Online JavaScript Minifier?

You can easily compress your JS code by following these.

  1. Fill the input field with your JavaScript code that will be converted into minified version.
  2. Click the button "Minify" to start minification.
  3. If there is no validation error in your code, you can get the result as raw code by copying to your clipboard or as a downloadable file called script.min.js.