Start for $1
  • $1 for a 7-day trial. When the 7 days end, your card is charged from $95 a month for one site, and the plan renews every month until you cancel.
  • Cancel any time with our ready-made cancel email. No reason needed.
  • Your first paid month can be refunded within 7 days of paying it. Write to hello@blogautopost.com.

Heading outline and table of contents builder

Paste Markdown or HTML to see its headings, get an anchor for each, copy a ready-made table of contents and read warnings about skipped levels.

Last updated

Pasted text stays in your browser.

Paste a page above to see its headings.

What the tool does

Paste the Markdown or HTML of a page and the tool lists its headings in order with their level, builds an anchor for each one, and writes a table of contents in Markdown and in HTML that you can paste back in. It also reads the structure for problems and lists them. Pasted text stays in your browser.

How the input is read

Markdown follows the CommonMark rules. A heading can be written with leading hash marks (ATX style) or as a line of text underlined with equals signs for a level-one heading or hyphens for level two (setext style). Hash marks inside a fenced code block, written with backticks or tildes, are code and never headings. A block of front matter at the top of the file is skipped, and closing hash marks on a heading line are not part of its text. Links, code spans and emphasis inside a heading are reduced to their plain text.

HTML is read by the browser itself. The tool hands your text to the browser's DOMParser, which builds an inert document in which scripts do not run, then collects the h1 to h6 elements in document order. It never searches the text with a pattern, so headings inside comments, scripts or attributes are not mistaken for real ones, and whitespace inside a heading is collapsed.

Anchors

Each anchor follows the same rule as the slug generator: accents are folded, every run of other characters becomes one hyphen, and the result is lower case. Letters of other scripts, such as Greek or Hindi, are kept so those headings keep their own anchors. When two headings produce the same anchor, the second gets -1 and the third -2, in order, and a suffix is never reused. An empty heading gets no anchor and no line in the table of contents.

The warnings

WarningWhen it appearsWhy it matters
No h1The page has no level-one heading.Most pages name their topic with one h1.
More than one h1Two or more level-one headings.A rule of thumb for most pages, not a requirement.
Skipped levelA heading jumps down more than one level, such as h2 to h4.The W3C Web Accessibility Initiative advises against skipping heading ranks because it confuses people who navigate by headings.
Empty headingA heading with no text.It adds a stop for screen reader users and says nothing.
Long headingA heading of more than 70 characters.A readability threshold chosen for this tool, not a rule of any search engine.

Google has said that for search the order and number of headings does not matter, while semantic order is very good for screen readers. The warnings are therefore about people reading and navigating the page, not about rankings.

Worked example

The sample page below mixes both heading styles, repeats a heading, skips a level and has a code block that looks like it holds a heading. The tool produced everything after it.

Sample Markdown page
# Plan a blog calendar

Pick a rhythm
-------------

## Topics

#### Batch the writing

~~~
# This line is code, not a heading
~~~

## Topics

### Questions to answer
#LevelHeadingAnchor
1h1Plan a blog calendar#plan-a-blog-calendar
2h2Pick a rhythm#pick-a-rhythm
3h2Topics#topics
4h4Batch the writing#batch-the-writing
5h2Topics#topics-1
6h3Questions to answer#questions-to-answer

Warnings: Heading 4 jumps from h2 to h4, skipping h3.

Markdown table of contents (h2 to h4)
- [Pick a rhythm](#pick-a-rhythm)
- [Topics](#topics)
  - [Batch the writing](#batch-the-writing)
- [Topics](#topics-1)
  - [Questions to answer](#questions-to-answer)
HTML table of contents (h2 to h4)
<ul>
  <li><a href="#pick-a-rhythm">Pick a rhythm</a></li>
  <li><a href="#topics">Topics</a>
    <ul>
      <li><a href="#batch-the-writing">Batch the writing</a></li>
    </ul>
  </li>
  <li><a href="#topics-1">Topics</a>
    <ul>
      <li><a href="#questions-to-answer">Questions to answer</a></li>
    </ul>
  </li>
</ul>

Using the table of contents

The anchors in the table of contents only work when the headings on your page carry the same ids. Many Markdown renderers and CMS themes add heading ids on their own; check that yours spells them the same way, or add the ids by hand. Choose the shallowest and deepest levels to list with the two selectors above the output.

Frequently asked questions

Why are the headings inside my code block ignored?

Text inside a fenced code block is code, not part of the page structure, so a line that starts with hash marks there is not a heading. The tool follows the CommonMark rule for fences made of backticks or tildes, including a longer closing fence.

Does a second h1 hurt my search results?

Google has said that the order and number of headings does not matter for search. The warning is a rule of thumb for readability and accessibility: most pages name their topic with a single h1.

Can I paste a whole HTML page?

Yes. Choose HTML as the input format and paste the page or a fragment. The browser parses it, ignores scripts and comments and lists the h1 to h6 elements it finds.

Why do two headings have anchors ending in -1 and -2?

Anchors must be unique on a page. The first heading with a given name keeps the plain anchor, the next gets -1, the one after -2, and so on.

Is my text uploaded?

No. The text is parsed in your browser and never sent to a server.

Sources

Put BlogAutoPost on your blog

Start a 7-day trial, connect your WordPress, Shopify or Webflow blog and approve the first draft yourself.

  • $1 for a 7-day trial. When the 7 days end, your card is charged from $95 a month for one site, and the plan renews every month until you cancel.
  • Cancel any time with our ready-made cancel email. No reason needed.
  • Your first paid month can be refunded within 7 days of paying it. Write to hello@blogautopost.com.