Skip to main content

HTML Heading Extractor

API reference

Extract every H1–H6 heading from pasted HTML as an indented outline, with a heading-structure audit for missing or duplicate H1s and skipped levels.

Input

Output

Heading outline
Structure audit
Was this helpful?

More ways to use this tool

REST API

curl -X POST https://api.iotools.cloud/v1/tool/html-heading-extractor \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "htmlSource": "<html>\n<body>\n  <h1>Ultimate Guide to Coffee</h1…",
    "maxLevel": "6",
    "indent": "true"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `html-heading-extractor` tool (HTML Heading Extractor) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Embed widget

<iframe
  src="https://iotools.cloud/embed/html-heading-extractor/"
  width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
  title="HTML Heading Extractor — iotools.cloud"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
  allow="clipboard-write"
  style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>

Drop this into your own page — free, no key required, just a link back.

Cost per API/MCP callFrom 5 credits
Need more credits?View pricing

Also available with

Guides

The HTML Heading Extractor lists every <h1> through <h6> in an HTML document as a clean outline, and checks the heading structure for the problems that hurt SEO and accessibility. Everything runs in your browser — the HTML you paste never leaves your device.

How to use this tool

  1. Paste an HTML document or fragment into the input box.
  2. Choose how deep to go (H1 only, down to H3, all levels…) and whether the outline should be indented by level.
  3. Copy or download the outline. The Structure audit box reports anything worth fixing.

Headings inside comments, <script>, <style> and <template> blocks are ignored, inline tags such as <span> or <a> are stripped from the heading text, and HTML entities are decoded.

What the audit checks

  • Missing H1 — a page with headings but no top-level one.
  • Multiple H1s — usually a sign of a template problem; one H1 per page is the common recommendation.
  • Skipped levels — for example an <h2> followed directly by an <h4>, which breaks the outline screen readers rely on.
  • Empty headings — heading tags with no visible text.

Why extract headings?

Headings are the skeleton of a page: search engines use them to understand topics, and assistive technology uses them for navigation. Pulling them out on their own makes it easy to review a page's structure, build a table of contents, or compare your outline against a competitor's.

h1h2headingsoutlineseodocument structuretable of contentshtml parser

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.