DOM Tools / DOM Size Checker

DOM Size Checker

Paste HTML to count total DOM nodes, measure nesting depth, analyze element distribution, and get specific fixes for DOM bloat. Improve Core Web Vitals without needing a live URL.

Node count Max depth Tag distribution Lighthouse thresholds No login

DOM Size Checker

Paste your full page HTML below. The tool counts all nodes, maps nesting depth, identifies the heaviest elements, and flags issues against Google Lighthouse thresholds.

// DOM Size Checker — Lighthouse thresholds applied Optimal: <800 nodes · Warning: 800–1,499 · Critical: 1,500+
Ctrl+Enter to run
0 DOM Nodes

Google Lighthouse DOM Thresholds

These are the exact thresholds Lighthouse uses when auditing DOM size in its performance reports.

MetricOptimal (Green)Warning (Orange)Critical (Red)Impact
Total DOM nodes< 800800–1,4991,500+Style recalculation, layout cost
Max DOM depth< 15 levels15–31 levels32+ levelsLayout reflow propagation
Max child nodes< 30 children30–59 children60+ childrenRendering bottleneck at node
Div ratio< 40% of total40–60%> 60%Over-nesting, unnecessary wrappers
Script tags< 1010–20> 20Parser blocking, memory
Comment nodes< 5050–200> 200Minor — remove from production

How to Fix DOM Bloat

Ranked by impact. Most pages can reduce DOM size 30-60% with divitis removal and lazy loading alone.

Remove wrapper divs (divitis)

The most common DOM bloat cause. Every element wrapped in a <div class="wrapper"><div class="inner"> pattern adds 2+ nodes per component. Use CSS Grid or Flexbox directly on the parent container — it eliminates the need for wrapper divs entirely.

  • Before: <div class="card-wrap"><div class="card-inner"><p>…</p></div></div>
  • After: <p class="card">…</p> with CSS Grid on parent
  • Average reduction: 15-25% of total DOM nodes in component-heavy pages

Lazy-load below-fold content

Don't render DOM nodes for content the user hasn't scrolled to yet. The Intersection Observer API lets you insert elements into the DOM only when they enter the viewport.

  • Use loading="lazy" on images and iframes — browser native, no JS needed
  • Use content-visibility: auto on sections — browser skips rendering off-screen sections
  • Virtualize long lists — only render visible rows (react-window, vue-virtual-scroller)

Audit third-party scripts

Third-party scripts (chat widgets, ad networks, analytics, A/B testing tools) are often the largest invisible source of DOM bloat. They inject nodes after page load that don't appear in your source HTML.

  • Intercom, Drift, Zendesk chat: 300-800 injected nodes each
  • Google Tag Manager containers: varies but can be 100-400 nodes
  • Facebook Pixel + SDKs: 50-200 nodes
  • Audit with Chrome DevTools: after load, run document.querySelectorAll('*').length in Console

WordPress-specific fixes

WordPress sites often have 2,000-8,000 DOM nodes due to theme and plugin overhead.

  • Disable unused widgets in sidebars and footers — each widget adds 10-50 nodes
  • Remove Font Awesome if using only 2-3 icons — it adds hidden <svg> sprite with 500+ nodes. Use inline SVGs instead.
  • Disable Gutenberg full-site editing if not using it — adds wrapper divs to every block
  • Use WP Rocket or Perfmatters to defer and remove plugin scripts that inject DOM nodes

DOM & Performance Tools

DOM Size Checker – FAQ

What is DOM size and why does it matter for SEO?+
DOM size is the total number of HTML nodes in a webpage. Google Lighthouse flags pages with over 1,500 DOM nodes as having excessive DOM size. Large DOMs slow style calculations, layout reflows, and garbage collection — directly impacting Interaction to Next Paint (INP) and Total Blocking Time (TBT), which are Core Web Vitals signals used in Google's Page Experience ranking algorithm.
How many DOM nodes is too many?+
Google Lighthouse thresholds: under 800 nodes = optimal. 800-1,499 = warning. 1,500+ = fail. The critical cases are a DOM tree deeper than 32 levels or any single parent with more than 60 child nodes. Most well-optimized pages have 400-900 nodes. Heavy WordPress pages with many plugins often exceed 3,000-5,000 nodes.
How do I check DOM size in Chrome?+
Three ways: (1) Chrome DevTools → Console → type document.querySelectorAll('*').length and press Enter. (2) Lighthouse audit → Performance tab → scroll to "Avoid an excessive DOM size" — shows total nodes, max depth, and worst parent. (3) DevTools → Elements tab → right-click the html tag → Copy outerHTML → paste here for offline analysis. The paste-here approach also works for staging environments not accessible via URL.
Does DOM size affect Core Web Vitals?+
Yes, indirectly but significantly. Large DOMs increase the time browsers spend on style recalculation and layout — operations that block the main thread. This directly increases Total Blocking Time (TBT) and Interaction to Next Paint (INP). INP became a Core Web Vitals metric in March 2024 and is now used as a ranking signal. A DOM over 1,500 nodes can add 50-300ms to INP on mid-range Android devices, which is the device class Google primarily measures.
Why does my DOM size differ between this tool and Lighthouse?+
This tool analyzes static HTML you paste — it counts nodes in the source before JavaScript execution. Lighthouse measures the live rendered DOM after all scripts run. Third-party scripts (chat widgets, ad networks, Google Tag Manager) inject hundreds of additional nodes after page load that don't appear in source HTML. If your Lighthouse DOM count is significantly higher than this tool's count, third-party script injection is likely the cause.