Online JavaScript/CSS Compression Using YUI Compressor

Select a file you want to compress. This tool uses YUI Compressor 2.4.2.

To use, copy/paste your code into the text area or select a file to upload. Then choose your compression type, JS or CSS. Finally, press the compress button.

Compress a JS/CSS code block or file
  • Global Options
    JavaScript Options

    Further Reading

    Helping the YUI Compressor
    Running your JavaScript code through YUI Compressor results in tremendous savings by default, but there are things you can do to increase the byte savings even further.
    Minification vs Obfuscation
    A minifier removes the comments and unnecessary whitespace from a program. Depending on how the program is written, this can reduce the size by about half. An obfuscator also minifies, but it will also make modifications to the program, changing the names of variables, functions, and members, making the program much harder to understand, and further reducing its size in the bargain.
    The Elements of JavaScript Style [ Part 1 | Part 2 ]
    When we talk of style here, we are not talking about fads and fashions, nor are we talking about CSS or conventions of layout or typography. We are talking about timeless qualities of expression which can substantially increase the value of a codebase. For companies whose valuations are are inextricably bound to their codebases, style should be a vital concern.

    Changelog

    May 30, 2009
    • jump to output after compression
    • upload multiple files
    March 10, 2009
    • fix multi-byte character handling. (thanks Alex)
    January 18, 2009
    • changed to YUI compressor 2.4.2
    • added line-break option
    • added verbose option
    November 7, 2008
    • changed to YUI Compressor 2.4.1
    • added some links to further reading
    • fixed utf-8 encoding
    October 7, 2008
    • valid HTML markup for kicks
    October 4, 2008
    • added error reporting
    • escape compressed code
    October 2, 2008
    • changed to YUI Compressor 2.3.6
    • stopped escaping double quotes
    • hide command

    Todo

    If you have any feedback, or have a feature request, hit me up at gpbmike@gmail.com.