Skip to content
SEO-Wars

Performance

HTML size: ship lighter markup

Heavy HTML takes longer to download and parse. We count markup without scripts and styles: up to 100 KB earns full points, over 300 KB earns none.

Category
Performance
Points available
7 pts · 4 with PageSpeed
Effort
Medium effort

Why it matters

The browser must download and parse the HTML before it can show the page. Oversized markup slows that down, especially on mid-range phones and slow connections.

Bloated HTML usually means repeated inline SVGs, huge mega menus, hidden duplicate content for mobile and desktop, or base64-encoded images. All of it is downloaded on every page view and cannot be cached separately.

How we measure it

We take the HTML of the page and remove the contents of every <script> and <style> block, then measure what is left in bytes (uncompressed). Inline JavaScript and CSS are not counted here; inline SVGs, data URIs and repeated markup are.

With PageSpeed data the check is worth fewer points, because the real loading metrics are scored as well.

ResultWithout PageSpeedWith PageSpeed
100 KB or less74
100-300 KB42
More than 300 KB00

Performance weights change when PageSpeed Insights data is available: TTFB, HTML size and redirects then share the 22 performance points with LCP, CLS and INP.

How to fix it

  1. Move repeated inline SVG icons into one sprite file and reference them with <use href>.
  2. Replace base64 data: images with normal image files that the browser can cache.
  3. Do not render the same menu or content twice for mobile and desktop. Use one markup and CSS to change the layout.
  4. Paginate or lazy-load very long lists (product grids, comments) instead of printing hundreds of items at once.
  5. Remove leftover page-builder wrappers, hidden sections and HTML comments.

Copy-paste fixes

HTML
<!-- Before: the same 4 KB inline SVG repeated in every product card -->
<svg viewBox="0 0 24 24"><path d="M7 18c-1.1 0-2 .9-2 2s.9 2 2 2 ..."/></svg>

<!-- After: one cached sprite file, referenced by id -->
<svg width="24" height="24" aria-hidden="true"><use href="/icons.svg#cart"></use></svg>

<!-- Before: image embedded as base64 -->
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." alt="Team photo">
<!-- After: a normal, cacheable file -->
<img src="/img/team.webp" alt="Team photo" width="800" height="533" loading="lazy">

Common mistakes

  • Hiding content with display:none and thinking it costs nothing. It is still downloaded and parsed.
  • Inlining the full SVG logo and icon set on every page.
  • Relying on gzip alone. Compression helps transfer time but the browser still parses the full markup.

Test your site now

Put your site against a competitor and see how many of these points you earn, and which fixes pay off first.

Start a duel
← All checksUpdated December 1, 2026
HTML size: why it matters and how to fix it · SEO-Wars