Friday, March 6th, 2009

Calculate your content to markup ratio

Category: Tip, Utility

<p>Stoyan Stefanov has created a fun little bookmarklet that calculates the content to markup ratio of a webpage:

When you care about performance, or SEO (or just doing a good job as web dev) an interesting data point is the ratio of page content vs. the markup used to present this content. Or… how much crap we put in HTML in order to present what the users want to see – the content.

So I played tonight with a bookmarklet to provide this piece of stats.

The bookmarklet code is served from here. The code is also on github.

And some fun results:

Here are some random results of running the bookmarklet on different sites.

http://www.cnn.com:
Total size: 92004 bytes
Content size: 11475 bytes
Content-to-markup ratio: 0.12
Fair ratio * : 0.16

http://www.sitepoint.com

Total size: 65989 bytes
Content size: 16199 bytes
Content-to-markup ratio: 0.25
Fair ratio * : 0.60

Article on http://en.wikipedia.org:
Total size: 21648 bytes
Content size: 3315 bytes
Content-to-markup ratio: 0.15
Fair ratio * : 0.35

http://www.phpied.com
Total size: 31899 bytes
Content size: 7933 bytes
Content-to-markup ratio: 0.25
Fair ratio * : 0.48

http://www.google.com SERP
Total size: 29963 bytes
Content size: 3351 bytes
Content-to-markup ratio: 0.11
Fair ratio * : 0.14

Related Content:

Posted by Dion Almaer at 2:58 am
3 Comments

++++-
4.4 rating from 15 votes

3 Comments »

Comments feed TrackBack URI

Not really a bookmarklet but worked pasting int he code into firebug :)
I guess the next reasonable question on this would be “what’s a good ratio?” I’d say a reasonable ratio is around 0.50

Comment by andriijas — March 6, 2009

Few years ago I measured the content-to-markup ratio on about a million web pages: http://triin.net/2006/06/12/HTML#figure-9

Might be of interest.

Comment by nene — March 6, 2009

@andriijas
The link in this article doesn’t work as a bookmarklet, but there’s a functional one on the creator’s page: http://www.phpied.com/content-to-markup-ratio-bookmarklet/

Comment by jsutcliffe — March 6, 2009

Leave a comment

You must be logged in to post a comment.