Markdown Table of Contents
Paste any Markdown document and get a nested table of contents generated from its ATX headings (# to ######). Anchors use GitHub-compatible slugs, custom {#anchor} targets are honoured, fenced code blocks are skipped, and output can be GitHub-style bullet links, a plain indented list, or nested HTML. Fully on-device.
🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.
Options
Your result will appear here
Type or paste your input above, adjust the options, then press Run. Tip: press Ctrl+Enter to run, and ? for every shortcut.
How it works
The outline it builds
Paste Markdown and the tool walks its lines for ATX headings, one to six hashes before a space, and builds a nested outline using the level of each heading. Fenced code blocks are skipped so sample files full of hashtags stay out. The output is returned as plain text you can paste into a README.
Anchor slugs
Links follow the GitHub convention: lowercase, keep letters digits underscores and hyphens, drop other punctuation, and turn whitespace into single hyphens. An explicit custom target at the end of a heading overrides the slug and is dropped from the link text.
Three output formats
GitHub emits bullet links such as - [Title](#slug). Plain indents each heading title by two spaces per level. HTML wraps every entry in a nested unordered list with anchors, escaping ampersands and angle brackets in the titles.
Depth and when to use it
The depth option caps how deep the outline goes, from 1 to 6, defaulting to all levels. Most READMEs link h1 to h3, so trimming the depth keeps implementation notes out of navigation. Generation runs locally and your document is never uploaded.
Questions
Which heading syntax is supported?
ATX headings: a line starting with 1–6 # characters followed by a space (or a #-only line is treated as empty and skipped). Setext underlines are not expanded; if your document uses them, convert the top-level titles to # first.
How are the anchors generated?
With the GitHub convention: lowercase, keep letters/digits/underscores/hyphens, drop punctuation, turn whitespace into single hyphens. An explicit {#custom} at the end of a heading overrides the slug and is removed from the link text.
Are code blocks ignored?
Yes. Headings inside fenced code blocks (``` on both sides) are not included, so example documents that show hashtags stay out of the outline.
Should tables of contents be limited by depth?
Most READMEs link h1–h3. The depth option lets you cap how deep the outline goes — useful when h4+ headings are implementation notes you do not want to navigate.
Related tools
See categoryMarkdown Table Formatter
Normalize Markdown pipe tables and optionally align their columns.
Markdown to HTML
Convert Markdown to HTML source code — see the generated markup, not a preview.
HTML to Plain Text
Strip HTML tags to clean, readable plain text — entities decoded, block layout preserved.
Text Statistics
Count characters, words, sentences and paragraphs, with platform limits, readability scores and reading time.