Free JavaScript Optimizer (Online Version)

This tool will let you optimize your JavaScript (JScript) code by removing comments, whitespace as well as other unnecessary characters as well as by optionally shortening function / variable / class names.
 
Other than regular JavaScript code, this tool accepts extensions (based on C/C++ preprocessor syntax) which allow further optimization, in particular shortening custom names (e.g. of functions, variables, classes) and conditionally removing unused portions of code (e.g. used for debugging purposes or versions for different browsers).
 
Click here for detailed instructions of optimizer's extensions syntax.
 
Optimizing JavaScript code is very useful. You can expect size reduction of 20-50% depending on your coding style and the use of tool's extensions. On one hand it will make your pages load faster and, on the other hand, it will cause your pages to work much faster, once they're loaded. The reason for this is that the browsers must interpret JavaScript code so its size is very important. Another advantage (especially when using the name-shortening feature) is that your JavaScript code will be less readable making it very difficult to steal it. On the other hand, for you as the developer, the original code will stay well formatted, also allowing you to use meaningful variable and function names and to add lots of comments etc. without the normal size overhead.
 
Paste your JavaScript code (pure JS, without HTML) to be optimized into the box below (max. 128KB)