How can I estimate the size of my JavaScript file after it is gzipped? Are there online tools for this? Or is it similar to using winzip for example?
http://closure-compiler.appspot.com/home lets you paste in code, and it will give you compression ratios for a particular file before and after GZIP.
Original Size: 90 bytes (100 bytes gzipped) Compiled Size: 55 bytes (68 bytes gzipped) Saved 38.89% off the original size (32.00% off the gzipped size)
You can use the pretty-print and white-space only options to estimate the compression of non-minified content.
If you need an estimate:
gzip -c "$f" | wc -c
and wc -c "$f"
Cygwin contains command line implementations of gzip
and wc
for Windows.