Friday, March 6th, 2009

Calculate your content to markup ratio

Category: Tip, Utility

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.
Total size: 92004 bytes
Content size: 11475 bytes
Content-to-markup ratio: 0.12
Fair ratio * : 0.16

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

Article on
Total size: 21648 bytes
Content size: 3315 bytes
Content-to-markup ratio: 0.15
Fair ratio * : 0.35
Total size: 31899 bytes
Content size: 7933 bytes
Content-to-markup ratio: 0.25
Fair ratio * : 0.48 SERP
Total size: 29963 bytes
Content size: 3351 bytes
Content-to-markup ratio: 0.11
Fair ratio * : 0.14

Posted by Dion Almaer at 2:58 am

4.4 rating from 15 votes


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:

Might be of interest.

Comment by nene — March 6, 2009

The link in this article doesn’t work as a bookmarklet, but there’s a functional one on the creator’s page:

Comment by jsutcliffe — March 6, 2009

Leave a comment

You must be logged in to post a comment.