Online JavaScript Compression Tool

Javascript Code Input

Alpha BRAIN For Gaming

Javascript File Upload

Multiple file uploads will be combined in order and compressed together as one file.

+ Upload Another File

Compressed Javascript Output

Alpha BRAIN For Gaming

What Is This?

You might be asking yourself where you can find a simple online file compressor for JavaScript files. Well today is your lucky day, you have found one of the best file compression tools on the web for all your JS files. Shrink file size with ease, just copy-paste, generate your code, paste the results to your production web server and off you go.

This is an online JavaScript compressor/minifier that allows you to compress and minify your javascript files. Compressed Java Script files are ideal for live production environments since it will typically reduce the file size by 25-90%. Most of the filesize reduction is achieved by removing comments, extra whitespace characters, new line characters, and sometimes block delimiters that are not needed by web browsers or visitors, without changing its functionality. These things are put into code to add readability, but are not required for it to actually execute.

Compress Javascript? Why The Heck Would I Want To Do That?

There are a number of reasons why compressing your javascript files is a good idea:

  • Quicker download times for your users.
  • Reduced bandwidth consumption of your website.
  • Reduced number of HTTP requests on your server when combining many javascript files into one compressed file, thus reducing the server load and allowing more visitors to access your website.
  • Comments and whitespace are not needed for javascript execution; Removing them will speed up script execution times.

You will quickly see the difference once you have minified your JavaScript. It is a general recommendation to compress your JS if the file is larger than 4096 bytes, if your JS is less than this total you will not get any real improvements so please be aware of this fact. If there is more than 25 bytes that the file can be compressed by, you should see a benefit

Minified source code is extremely useful for interpreted languages that are deployed and transmitted over the Internet (ex. JavaScript), because it reduces the amount of data that needs to be transmitted. Source code that has been minified may also be used as a kind of obfuscation. Minification can be distinguished from the more general concept of data compression in that the minified source can be interpreted immediately without the need for an uncompression step, the same interpreter can work with both the original as well as with the source that has been minified.

What Javascript Compression Method is Used?

This free online Java Script compression tool uses UglifyJS 2 for all javascript minification and compression.

UglifyJS implements a general-purpose JavaScript parser, compressor, beautifier toolkit. It is developed on NodeJS. The tokenizer/parser generates an abstract syntax tree from the JS code. You can then have various manipulations done to the code. For more information about UglifyJS please visit their GitHub page's README

You DO NOT actually install UglifyJS or anything else to have this free online JS minification/compression tool work, never are any changes done to your computer either.

How Much Will It Cost To Use This?

This is brought to you ABSOLUTLY FREE. We believe in the Open Source community and this project/tool uses all Open Source technologies and this is our way of giving back to others

We do display Ad's on this page to help cover a small portion of the infrastructure costs to bring this tool to you for free.

Other Facts About Using Our Online Tool

This tool will not download anything on, nor install anything on your computer. You simply just have to copy and paste your Java Script into the box or upload your JavaScript files, then you will download the new combined and minified JS file. We never store anything you minify compress or upload, the temporary files are destroyed immediately.

Since there is nothing to install using this, there is nothing to worry about un-installing later on down the road or remembering to make sure you updated it.

This tool does not make any changes to your computer or the computer's settings, so no worrying about remembering what you did or had changed on your computer. This is a OS, Browser and computer independent tool. All the work is done on our servers, then destroyed after outputting the code or once you have downloaded the new combined file, or once you leave the site.

Don't stress about installation choices as there is never any using this tool as it is all online.

We do not bundle (unless you are bundling your JS files) or distribute anything harmful, nothing goes on to your machine and you can review all modifications UglifyJS makes to your code before deploying it on your website. Which is wise to do regardless of your library or tool of choice for your minification purposes.

What other things can I do to help increase my websites page load speed?

If you are trying to help increase your data transmission in all areas you can also add gzip compression with your web server. All major browsers support data being sent in gzip. You might be asking yourself why would I need to minify if I am going to run gzip compression on the data anyways. The main difference between the two types is minifying is a lossy compression, whereas gzipping is lossless. For example

$ curl | gzip > jquery.gz
$ curl | gzip > jquery-min.gz
$ curl > jquery-1.10.1.min.js
$ curl > jquery-1.10.1.js

$ ls -la jquery*
-rw-r--r-- 1 user group 81335 80K Jul 20 22:19 jquery.gz
-rw-r--r-- 1 user group 274080 268K Jul 20 22:24 jquery-1.10.1.js

-rw-r--r-- 1 user group 32791 33K Jul 20 22:20 jquery-min.gz
-rw-r--r-- 1 user group 93064 91K Jul 20 22:22 jquery-1.10.1.min.js

As you can see even once minfied adding gzip compression to the file still gives you an overall saving. Great stuff you're saying, well to get this going you will have to refer to your web server of choices DOC's since there is no set singular method to enable it. But all are very easy, who knows if you are on a hosting plan or your default configuration on your server might just actually have it enabled already and you are benefiting from it. This test is just a very dirty and simple example and please take the compression results as just that.

It can also speed up parsing of the javascript in the end users browser. If the files the browser has to parse are large it is just going to increase the actual parsing and tokenising the file. Theoretically minifying your JavaScript file may lead to more repetitions of the same text, which if you are using gzip compression as well, could mean slightly higher compression.

Another great tip is to make sure all the images on your site are sized to what you are going to display them at for your end users. You can also make sure the image file has been compressed the most without altering your actual image size. Of course after a certain point you will degrade your images quality, so make sure you view your image before pushing live.

Make sure you do not have any uneccessary resources running. Such as if you are running a blog, don't just install plugins to install them, everyone you enable requires resources to run which can impact your end users expierence. Or say you have services running on your box that are not really required, make sure you are only running exactly what is required and nothing more, this can also help mitigate any extra security hassles. The best thing to keep in mind is the more resources running can lead to slower page load times.

One big thing many seem to forget is to make sure any scripts you are using are actually up to date and to make sure you take care of all depreciated functions/variables as they arrise. A good example would be say you are running jquery.min.js and you never touched the file after you setup your site or had it built. There is a very good possibility that you are running an outdated version, many times sites are multiple versions behind. This can also open you up to security issues or exploits.

CDN's or Content Delivery Networks are a great way to serve content like images. What they can do for you is serve the content to your end users at the closest possible location around the world, which in turn means even faster load times for your visitors around the globe.

Browser caching is another great method to help speed up your page load. This technology helps for when your visitors come back to you site. If it is within your cookies life span the content will then be called from their cache instead of actually downloading the file again. The best way to do this is with the actual webserver, there are plugins for blogs and similar types tools. But you will get your best results properly configuring it on the webserver.

A preffered method by many is to put your CSS files at the top of your page and have all your JS files or snippets at the bottom. By putting your CSS at the top it prohibits progressive rendering, which will help save resources the browser would use when it loads and redraws the elements on your page. By putting your javascript at the bottom of the page, it prevents your pages from waiting on the full execution of the code before it can continue loading. This will in turn lead to a faster load time.

Hey I don't seem to be getting a noticeable result.

You may not be noticing any significant change in many factors such as file size or the browser seems to be taking just as long. It is very possible the saving you are getting are not enough to be truly noticed, or there is no real savings. The only true way to see if minifying or even adding in gzip compression will help is to run your own benchmarking and profiling. Every situation is different

We Respect Your Privacy

We never store, nor collect any personally identifiable information. This site does make use of Analytics to track visitors, but no actual personally identifiable information is ever kept about you. We believe privacy is a right and not an option and do not want to be tracked anymore than you.

We use analytics to track the success of the tools use and any issues that may come up, so we can always provide you a simple, fast and painless experience to quickly minify your JavaScript files.

If you have Do Not Track set in your browser we honor that and do not collect any information about your visit, which includes nothing unidentifiable about you, if this is set there is absolutely nothing stored about your visit and use on this site.

Help keep this tool online/developed and have new features added.

If you found this tool helpful please send a small donation, even enough for a cup of coffee is great. You can also leave suggestions or feature requests in the donation, we welcome it. A big thanks to all those who have donated, stay tuned for the CSS minify tool.

Brain Quiz