Book & Print Tools › Book TOC builder

Converter

Book table of contents builder for Markdown

A table of contents helps readers find their way, and it is simple to build from the headings you already wrote. Paste your manuscript and this tool lists every heading as a nested, linked list.

Choose how deep the list goes. Level 1 gives chapters only; level 2 adds sections. Turn on numbering to get 1, 1.1, 1.2 style numbers. Headings inside code blocks are ignored, and repeated headings get the same numbered anchors that Markdown viewers use.

The output is plain Markdown, so you can paste it near the top of your file. Note that MarkdownBooks also builds a contents page for PDF output by itself, so you only need this list when you want one inside the text, for example in a README or an HTML page.

How to use it

  1. Paste your Markdown.
  2. Choose the depth and numbering.
  3. Copy the list and paste it into your manuscript.

Worked example

Three headings become a numbered, linked list.

Questions

Will the links work?
Yes in most Markdown viewers, which create anchors from heading text.
Are headings in code blocks listed?
No. They are skipped.
Do I need this for PDF output?
No. The PDF template builds its own contents page.
What about duplicate headings?
They get -1, -2 suffixes, matching common anchor rules.

Turn your Markdown into a book

Related tools