DOM Tools / 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.
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.
—
These are the exact thresholds Lighthouse uses when auditing DOM size in its performance reports.
| Metric | Optimal (Green) | Warning (Orange) | Critical (Red) | Impact |
|---|---|---|---|---|
| Total DOM nodes | < 800 | 800–1,499 | 1,500+ | Style recalculation, layout cost |
| Max DOM depth | < 15 levels | 15–31 levels | 32+ levels | Layout reflow propagation |
| Max child nodes | < 30 children | 30–59 children | 60+ children | Rendering bottleneck at node |
| Div ratio | < 40% of total | 40–60% | > 60% | Over-nesting, unnecessary wrappers |
| Script tags | < 10 | 10–20 | > 20 | Parser blocking, memory |
| Comment nodes | < 50 | 50–200 | > 200 | Minor — remove from production |
Ranked by impact. Most pages can reduce DOM size 30-60% with divitis removal and lazy loading alone.
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.
<div class="card-wrap"><div class="card-inner"><p>…</p></div></div><p class="card">…</p> with CSS Grid on parentDon'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.
loading="lazy" on images and iframes — browser native, no JS neededcontent-visibility: auto on sections — browser skips rendering off-screen sectionsThird-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.
document.querySelectorAll('*').length in ConsoleWordPress sites often have 2,000-8,000 DOM nodes due to theme and plugin overhead.