I am busy checking how my webserver is doing gzip. I'm confident now that gzip is on as chrome shows the content-encoding: gzip header.

Is there a easy way to see how much a file was compressed in the Chrome developer tools?

  • 1
    If there's a plugin for viewing HTTP headers, then you could just compare the document size to the Content-Length header. – Lèse majesté Oct 29 '10 at 13:19
up vote 16 down vote accepted

Updated answer for 2017: Yes.

The size column in the Network tab in Chrome Developer Tools has both the compressed and uncompressed size, for gzip, brotli and whatever comes in future. Eg:

Here the compressed size is 242 KB, the uncompressed size is 1.1 MB

To see both, ensure you have Devtools showing large request rows. It's the first icon in "View" options in the Networks-specific toolbar.

  • 5
    Thanks. Easy to miss that. One has to click "use large request rows" – alds Oct 12 '17 at 6:43

By far the easiest method is to use an online tool. GIDZipTest shows you plenty of detail: the original size, compressed size and compression percentage.


However, it is possible in Chrome with a bit of effort. (Updated for latest Chrome, Sept 2011.)

In the Developer Tools, go to the "Network" tab and reload the page. You will see a list of all the files fetched on the left column. Click the appropriate page/file on the left then the "Headers" tab on the right pane.

Under "Response Headers" you should see "Content-Encoding: gzip" followed by a "Content-Length" header. This is the size of the compressed content.

Finding the uncompressed size is more difficult. If you're serving up static files you can simply check its size. For dynamic content you'll have to copy-paste the HTML into a text editor and save it to check the exact size.

  • where is the "enable resource tracking" ? – Pacerier Sep 24 '11 at 2:10
  • @Pacerier: it's slightly different in the latest version of Chrome; I've updated my answer with new instructions. – DisgruntledGoat Sep 25 '11 at 23:47
  • Neat tool. I couldn't figure out why responses being sent by my Google App Engine app weren't showing the compressed size. Responses sent by the SDK (ie localhost) aren't compressed while responses coming from the cloud are. Turns out, Chrome is working perfectly. – Evan Plaice Jun 4 '12 at 23:56

Another way to accomplish this is with cURL:

curl -i -H "Accept-Encoding: gzip" http://someurl.com | wc -c

versus

curl -i http://someurl.com | wc -c

The number shown after each command is the number of bytes that crossed the wire.

Update for 2017

When using large icons, the chrome dev tools show a before and after compression size in the network tabs.

I confirmed by switching gzip off and on on my webserver.

Chrome dev tools screenshot

enter image description here

I've heard the one in chrome is flawed due to a bug in webkit.

The Y Slow Plugin for firefox does a great job. When running it go to the Components tab and expand the type of component you want the values for. It will show the original size and the gzip size.

This isn't a tool for Chrome specifically, but I use Fiddler when checking HTTP traffic/header information. It's a great tool, works on any browser and it's free!

  • 1
    There is a Chrome extension version of Fiddler now, too! – karlbecker_com Sep 16 '14 at 23:19
  • Thanks for suggesting this. Fiddler doesn't show "uncompressed size" but does let you add columns for "CompressionSavings" and "CompressionSavings%". Add them by right-clicking the columns ==> "Customize Colums" ==> "Miscellaneous" ==> The "Field Name" dropdown. – JasonS Jan 7 '16 at 15:09

For anyone still arriving here from a general google search (like I did), in modern versions of Firefox it's possible to see the "raw" and gzipped size directly from its devtools by comparing the "Transferred Size" column and "Size" column. "Size" is the raw size of the response, the "Transferred size" is the actual size of the data transferred for the response, which may be lower than actual size in case of gzip, like in the image below, or even 0 in case the response has been cached in the client.

firefox devtools gzipped size

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.