Take the 2-minute tour ×

I occasionally write JavaScript code. I am interested in minifying it for better performance, but I don't plan to spend to much time on that, especially in testing the minified result.

I found this online service: http://www.lotterypost.com/js-compress.aspx

So a couple questions:

  • Is it reliable?
  • Microsoft AJAX minifier vs. YUI Compressor, what's the best option?
  • Any other similar online tool to recommend (and why is it better than the above link)?
share|improve this question

closed as not constructive by Will Feb 7 '13 at 19:01


The Closure Compiler is as good as it gets: closure-compiler.appspot.com/home (beware, do NOT use the Advanced Mode unless you know what you're doing). –  Stephen Chung Apr 30 '11 at 10:16
Seeking a faultless minifier to avoid testing is the wrong approach. You're looking for a faultless minifier due to testing being hard. Make the testing easier! Create a good set of unit tests that can be run against the minified JavaScript to verify the functionality is correct, you then don't have to care much about the minifier you choose. –  Jon Cram Apr 30 '11 at 18:04

2 Answers 2

up vote 3 down vote accepted

That link you post happens to be the one that I use too.

Use the MS AJAX Minifer. It's way better than the yui one. besides:


The Microsoft Ajax team (I work on this team) has been using this tool internally for a number of years. For example, we use the Microsoft Ajax Minifier to minify the Microsoft Ajax Library before publishing it.

Well if you don't trust me, run your source code (if you don't have an actual source code to test, just grab the source at http://code.jquery.com/jquery-1.6.2.js) through both and see which is more "minified".


Google has the Google Closure Compiler but it analyzes your code and removes unreferenced code (to furthur reduce the size of the resultant file). However usually this is not what you want because even though the functions/variables are not referenced within that file, it may be referenced from your other js files that make up your site)

share|improve this answer

Google's Closure Compiler is an excellent Javascript minifier and compiler. It analyzes the code and reports the detectable errors. It removes redundant space and unreferenced code, and renames objects to shortest possible names. You just need to compile together all Javascript files that belong to one HTML page.

share|improve this answer
