Markdown Table of Contents (TOC) Generator

Instantly generate an anchor-linked Table of Contents for your Markdown documents.

Input Markdown Document
Output TOC

What is the Markdown TOC Generator?

The Markdown Table of Contents (TOC) Generator is a free, fast online utility designed to automatically create a structured, clickable table of contents for your Markdown documents. Long README files, documentation, and articles written in Markdown can be difficult to navigate. This tool instantly parses your document's headings and generates a nested list with anchor links, making it easy for readers to jump directly to the sections they need. It's an essential tool for developers, technical writers, and anyone managing extensive Markdown content.

How to Generate a Table of Contents

Creating a TOC for your Markdown document is incredibly simple and fast:

  1. Select your mode: Choose whether you want the output to be "TOC Only" or "Prepend to Document" (which adds the TOC to the top of your original text).
  2. Enter your Markdown: Paste your full Markdown document into the input area on the left.
  3. Generate: Click the "Generate TOC" button below the input.
  4. Get your TOC: The formatted, nested list of anchor links will instantly appear in the output area on the right.
  5. Copy the result: Click the "Copy" button to save the generated TOC (or the full document) to your clipboard, ready to be pasted into your project or editor.

100% Secure and Client-Side Processing

Privacy and security are paramount when dealing with your documents, documentation, and notes. ToolDojo's Markdown TOC Generator processes everything locally right in your web browser. Your document is never uploaded, transmitted over the internet, or saved to any external server. You can safely generate TOCs for sensitive internal documentation, private notes, or proprietary codebases knowing that your data remains strictly on your own device at all times.

Frequently Asked Questions

This tool scans your Markdown text for heading tags (lines starting with # to ######). It then extracts the heading text, creates a URL-friendly anchor link (slug) for each, and formats them into a nested, clickable list.

No. All generation operations are performed entirely within your web browser using JavaScript. Your document never leaves your device, ensuring complete privacy.

Yes, the generator is smart enough to ignore lines that look like headings but are actually inside Markdown code blocks (```), ensuring your TOC is accurate.