Markdown Outline Extractor
Extract a heading outline from Markdown — every ATX (#) and Setext (underline-style) heading, with its level, line number and a ready-to-use GitHub-style anchor slug for building a table of contents.
Input
Output
| Level | Heading | Anchor | Line |
|---|---|---|---|
| No data yet | |||
Guides
The Markdown Outline Extractor reads a Markdown document and pulls out every heading into a flat, ranked outline — the level, the text, its line number, and a ready-to-use anchor slug. It's the fastest way to build a table of contents, review a document's structure, or check that heading levels aren't skipping around.
What it extracts
Both heading styles Markdown supports are detected:
- ATX headings — one to six
#characters (#through######), with optional trailing closing hashes (## Section ##extracts as "Section"). - Setext headings — a line of text followed immediately by a line of
=(level 1) or-(level 2) underlines.
Each result row shows the level, the heading text, a GitHub-style anchor slug (lowercased, punctuation stripped, spaces turned into hyphens, duplicates numbered — the same scheme GitHub uses for its own Markdown anchors), and the line number it appears on.
How to use it
- Paste your Markdown into the input box — the outline updates live as you type.
- Use the copy or download button to export the outline as CSV, or copy the anchor column to hand-build a table of contents.
What gets skipped
Headings inside fenced code blocks (fenced with ``` or ~~~) are ignored, since a # inside a code sample isn't a real heading. Only genuine ATX and Setext headings in the surrounding prose are extracted.
Common uses
- Writers and documentation teams generating a table of contents for a long README or article.
- Editors checking a document doesn't skip heading levels (jumping from
#straight to###). - Developers scripting a docs pipeline that needs anchor links for cross-references.
- SEO teams auditing a page's heading structure before publishing.
Is my document private?
Yes. All extraction happens locally in your browser — your Markdown is never uploaded to a server.
Why does a duplicate heading get a "-1" suffix?
Anchor slugs must be unique on a page, so when the same heading text appears more than once, each repeat gets a numeric suffix appended (overview, overview-1, overview-2, ...) — the same convention GitHub and most static-site generators use for Markdown-rendered pages.