# Heading structure The H1 → H2 → H3 hierarchy of a page. Engines use it to decompose long content into extractable chunks; skipped levels or section headers in plain divs break the decomposition. By AgentSite · 2 min read · Updated 2026-05-24 Heading structure is the hierarchical use of `<h1>` through `<h6>` to mark section boundaries in extractable order. A clean structure (one H1, then H2 sections, then H3s inside H2s) lets the agent decompose the page into named chunks. Skipped levels or section headers built from styled `<div>`s break the chunking. ## The contract [MDN's heading reference](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements) is direct: "Do not skip heading levels: always start from `<h1>`, followed by `<h2>` and so on… doing so may create confusion, as the person navigating this way may be left wondering where the missing heading is." The same applies to AI extractors that parse the document outline. The [W3C WAI page-structure tutorial](https://www.w3.org/WAI/tutorials/page-structure/headings/) gives the rule plainly: "Nest headings by their rank (or level). The most important heading has the rank 1 (`<h1>`), the least important heading rank 6 (`<h6>`)." [WAI-ARIA's `heading` role](https://www.w3.org/TR/wai-aria-1.2/#heading) supplies the same semantics for cases where the document model uses ARIA roles instead of native heading elements — but native elements are the simpler, stronger signal. ## Why engines weight it A long page without internal headings is one opaque block of prose to an extractor. The engine has to either summarize the whole thing or guess where the sub-topics start. A long page _with_ clean headings is a named outline: H2 sections are the agent's candidate answers, H3 subsections are the elaborations. The same hierarchy is what [chunk size](/chunk-size) extractors use to bound the extraction window. For the [direct answer](/direct-answer) pairing: the H1 names what the page is about, the lede paragraph immediately under it answers the implied question, and the H2s below name the sub-questions the page answers in turn. An engine parsing all three reads a coherent document outline. ## Anti-patterns Three failures show up reliably: 1. **Skipped levels.** H1 then H3 then H4. The H2 layer is missing; the extractor doesn't know whether the H3 sections are peers of one missing H2 or a flat list. Some agents collapse them; some discard. 2. **Styled divs as headings.** `<div class="section-title">Pricing</div>` instead of `<h2>Pricing</h2>`. The visual reader sees a heading; the extractor sees a generic block. The hierarchy is invisible to anything that parses the document outline. 3. **Inconsistent depth across the page.** The first H2 has H3 children; the second H2 has H4 children; the third H2 has no children at all. The outline is not a tree, and chunkers that depend on tree shape produce uneven extracts. ## Where this fits Heading structure is a Layer 3/4 signal — the document outline that the engine reads alongside the content itself. It pairs with [h1](/h1) (the topmost element of this hierarchy) and [chunk size](/chunk-size) (the unit the hierarchy bounds). The layered place is in [the five layers of AEO](/five-layer-aeo); the failure catalog is in [AEO problems](/aeo-problems).