Skip to main content

How Quickly Can Chrome Parse HTML Code?

· 2 min read
Matt Zeunert

I've been thinking about HTML size a lot recently while improving our HTML Size Analyzer.

How much CPU processing is required to parse HTML code? I collected some quick data.

How long does it take Chrome to parse one megabyte of HTML?

I ran tests on several websites and found that parsing HTML took about 7 milliseconds on my laptop. In contrast, the low-end phone I use for testing takes 88 milliseconds, or 13 times as much time.

In terms of parser throughput this means my laptop can process 152 megabytes of HTML per second, while the low-end phone can process a bit over 11 megabytes per second.

Bar chart showing HTML processing time difference between fast and slow devices

Across 7 websites I checked on my laptop the values ranged from 4.9 milliseconds per megabyte to 8.3 milliseconds per megabyte.

Notes

To collect this data, I opened a new browser profile and disabled JavaScript execution in DevTools. I then collected a performance profile and checked the "Total time" value for the "Parse HTML" activity.

DevTools profile Parse HTML data

How long it takes to parse HTML code will depend on what's being parsed, for example HTML tags, inline styles, or embedded Base64 images.

Get a monthly email with page speed tips