Skip to main content

Heading Structure Analyzer

Extract and visualize H1-H6 heading hierarchy with SEO issue detection.

Reviewed by · Last reviewed

0
H1
0
H2
0
H3
0
H4
0
H5
0
H6

Using the Heading Structure Analyzer

  1. Paste your content - the textarea accepts raw HTML (with <h1> through <h6> elements) or Markdown (with #, ##, ### syntax). The analyzer auto-detects the format.
  2. Click "Analyze" - the tool parses the input, extracts every heading, records its level and text, and builds a tree reflecting nesting by level.
  3. Read the hierarchy tree - each heading appears at its nesting level, with warnings if the structure skips levels (e.g. H2 directly to H4) or contains multiple H1s.
  4. Scan the issue panel - it highlights three classes of problem: multiple H1s, skipped levels, and empty or duplicate heading text.
  5. Edit upstream and rerun - the output updates on each analyze click; iterate until the tree reads naturally as an outline of your content.

What the Parser Does

For HTML input, the analyzer uses the browser\'s DOMParser to produce a document fragment, then queries for all h1, h2, h3, h4, h5, h6 elements in document order. This catches headings inside <article>, <section>, and <main> wrappers, which a naive regex would miss. For Markdown input, it tokenizes line by line, matching ^#{1,6}\\s+ at line start to identify heading levels.

The hierarchy check walks the heading list in order, tracking the current level. A drop from H2 to H4 triggers a "skipped level" warning because it implies a missing H3 between them. Multiple H1s trigger a separate warning, since by HTML5 convention each document has a single H1 representing the main page topic - though HTML5\'s outline algorithm technically allows multiple H1s within <section> elements, browsers, screen readers, and search engines do not implement that outline algorithm. The practical rule remains: one H1 per page.

When to Run a Heading Audit

  • Auditing an inherited site or CMS where previous authors used headings for styling rather than structure - often H3 appears as body emphasis or H1 on every section header.
  • Checking accessibility - screen reader users navigate pages via heading lists (JAWS: Insert+F6, NVDA: H key), and broken hierarchy makes content unnavigable.
  • Validating content migrations between CMSes where heading tag mapping can silently break (Markdown #### converting to H3 instead of H4 is a real bug class).
  • Debugging why a page\'s rich snippet is missing - Google sometimes extracts table-of-contents sitelinks from heading structure and badly-structured pages lose that feature.
  • Teaching content authors the difference between semantic structure and visual styling by showing them their own page\'s tree.

Heading Pitfalls in the Wild

  • Using headings as styling shortcuts - "this section needs to look bigger, so I\'ll use H3 even though it is not a section heading" breaks the outline for everyone downstream.
  • Empty headings - <h2></h2> from a CMS template bug shows up as a structural gap. Screen readers announce "heading level 2, blank."
  • Duplicate heading text - three H2s all called "Overview" make it hard to navigate and suggest the author did not vary subsection labels.
  • H1 inside <header> vs <main> - some templates put the site logo text in an H1 in the header and the article title in an H1 in the main, giving two H1s per page. Pick one (typically the article title).
  • Skipping H1 entirely - starting a page at H2 happens on templates where the CMS inserts the title outside the content area and authors assume H2 is the top level. The page then has no H1.
  • Headings nested inside interactive widgets - tabs, accordions, and modal dialogs sometimes contain H2s that are hidden by default. The DOM has them; the hierarchy check counts them; users may not see them. Consider whether they belong in the page outline at all.

What Headings Are For in HTML, A11y, and SEO

Headings serve three audiences. For CSS, they are typographic anchors with implied visual hierarchy. For assistive technology, they are the primary navigation mechanism: screen readers let users jump heading-to-heading with a keystroke and announce the level. For search engines, headings are a content-structure signal: Google Search Central says "use heading tags where it makes sense" and warns against using them purely for styling. Headings also feed Google\'s passage ranking, which surfaces specific sections of long pages in SERPs. WCAG 2.1 Success Criterion 1.3.1 requires semantic structure including correct heading hierarchy for AA conformance.

Alternatives and Complementary Checks

Browser extensions like axe DevTools, Lighthouse, and WAVE check heading hierarchy alongside dozens of other a11y issues. For crawling a whole site, Screaming Frog and Sitebulb extract heading data per URL. For live in-page debugging, Chrome DevTools\' Accessibility panel shows the computed tree. This analyzer wins on unpublished content or Markdown drafts; it does not cover other a11y issues, so pair with a full audit before launch.

Frequently Asked Questions

Why should a page have only one H1?

Convention and consistency. HTML5's specification technically allows multiple H1s inside <code>&lt;section&gt;</code> elements via the outline algorithm, but no browser, screen reader, or search engine actually implements that algorithm. In practice, multiple H1s are interpreted as conflicting signals: assistive tech announces multiple "level 1" headings, Google has to guess which is the real page topic, and the document outline becomes ambiguous. One H1 is the de facto rule and the one this analyzer enforces.

What does "skipped heading level" mean?

Jumping from H2 directly to H4 without an H3 in between. The hierarchy implies H3 content should exist at the intermediate level; its absence suggests either a missing section or a misuse of H4 as purely visual styling. Screen readers announce levels literally ("heading level 4"), so skipping confuses navigation. Fix by either inserting a missing H3 section or promoting the H4 to H3.

Does Google actually care about heading structure?

Moderately. Heading tags are a weak direct ranking factor - John Mueller has called them "a small signal" - but they feed into passage ranking and the "jump to section" SERP feature that launched in 2021. A page with clean heading hierarchy is more likely to have individual sections surfaced for long-tail queries. The larger benefit is accessibility compliance (legally significant in many jurisdictions) and user experience, which indirectly feed quality signals.

Can I have multiple H2s?

Yes, and you should. H2s represent the main subsections under the H1. A typical article has 3-7 H2s, each optionally containing H3 subsections. Only H1 is "one per page" in the conventional interpretation; all other levels can repeat as the content warrants. What matters is that the nesting stays logical.

Does this analyzer detect Markdown headings?

Yes. Markdown uses <code>#</code> through <code>######</code> as heading markers (ATX style) or <code>===</code>/<code>---</code> underlines (Setext style, limited to H1 and H2). The analyzer recognizes ATX headings by default since they dominate modern Markdown authoring. Paste raw Markdown and the analyzer identifies levels from hash-marker counts.

What about ARIA roles like <code>role="heading"</code>?

The tool analyzes semantic heading elements (<code>&lt;h1&gt;</code>-<code>&lt;h6&gt;</code>) and does not scan for <code>role="heading"</code> with <code>aria-level</code> attributes applied to other elements. ARIA-attributed headings are a workaround for frameworks that generate generic <code>&lt;div&gt;</code> markup and should be rare - modern HTML with semantic elements is preferred. If your framework emits ARIA headings, add them to this tool's scope manually.

How does this compare to Google's heading extraction?

Google's crawler reads the rendered DOM after JavaScript execution, so a heading injected by client-side React is counted. This analyzer, pasted with server-rendered HTML, may miss client-injected headings. For authoritative Google-side inspection, use Search Console's URL Inspection tool, which shows the rendered HTML Google actually indexed. For static HTML drafts, this tool is accurate.

Should I use H1 for the site logo?

No. The H1 should describe the specific page content, not the site brand. Sites that wrap their logo in H1 give every page the same H1 ("Acme Corp" on the homepage, about page, and every blog post), which is useless for search engines and screen readers trying to identify the current page topic. Logo goes in <code>&lt;img alt="Acme Corp"&gt;</code> inside the header; H1 describes this particular page.

What about hidden headings inside tabs or accordions?

Screen readers and Google both see hidden content that is in the DOM, so a tabbed interface with H3s inside each panel counts those H3s in the hierarchy. Whether to include them depends on semantics: if each tab is a genuine content subsection, H3s are appropriate; if tabs are a navigation UI rather than content structure, keep them out of the heading hierarchy and use <code>&lt;button&gt;</code>s or <code>&lt;nav&gt;</code> instead.

Does the analyzer process my content in the cloud?

No. The parsing runs in your browser via <code>DOMParser</code> (for HTML) or a pure JavaScript tokenizer (for Markdown). Your text stays local. You can paste drafts under NDA, unpublished strategy documents, or internal templates without any third-party visibility.

Are headings required for SEO?

Not strictly, but their absence is a significant signal of low structure quality. A page with zero headings, only paragraphs, gets indexed but will struggle to rank for structured queries and will lose accessibility conformance. Even a simple page benefits from an H1 plus 2-3 H2s defining the main sections. The time cost is minimal; the signal improvement is worth it.

Can I check a live URL instead of pasting content?

Not here - the input is a local paste-in textarea. For live URL analysis, use a crawler like Screaming Frog or an online tool that fetches server-side. Server-side fetches cannot render client-side JavaScript frameworks without a headless-browser stage, so SPAs miss injected headings.

More SEO & Web Tools