OnlineNotes Logo

    Markdown TOC Generator

    Generate markdown table of contents blocks, heading maps, and anchor-ready links for long documentation pages.

    Input

    Output

      When to use this tool

      Use this page to review heading structure and generate table of contents links from markdown.

      It helps you catch nesting issues before you publish long documents.

      Frequently asked questions

      What is this outline used for?

      Use it to validate heading structure before publishing docs, changelogs, and long technical pages.

      Can I copy a markdown TOC?

      Yes. The tool generates a markdown table of contents with anchor links.

      Does this include preview?

      Yes. You can switch from structure views to rendered preview in the same page.

      Related tools

      Markdown table of contents generator for long technical documents

      Use this markdown table of contents generator to list every heading in a handbook, API doc, or migration guide and get a nested list of anchor links.

      The outline also shows each heading's level, which makes it easy to check the structure of a long document before it is published.

      How it works

      1. Paste markdown in the editor. The tool reads it line by line and keeps each line that starts with one to six # characters followed by a space.
      2. For each heading it makes an anchor: lowercase the text, remove anything except a to z, digits, spaces, and hyphens, then turn spaces into hyphens.
      3. The Outline view lists the level, the title, and the anchor. The TOC view shows the nested list, indented two spaces per level. The Preview view renders your document.
      4. Press Copy markdown TOC and paste the list near the top of your document.

      Worked example

      Input

      # User guide
      
      ## Install on Linux
      
      ### Step 1: download
      
      ## Install on Linux
      
      ## Café menu

      Output

      - [User guide](#user-guide)
        - [Install on Linux](#install-on-linux)
          - [Step 1: download](#step-1-download)
        - [Install on Linux](#install-on-linux-1)
        - [Café menu](#café-menu)

      Anchors follow the GitHub rule. The repeated heading gets -1 on its second use, and the accented letter stays, so "Café menu" gets #café-menu.

      Edge cases and limits

      • Lines inside code fences are skipped, so a "# comment" in a shell block stays out of the TOC.
      • Only hash headings count. Underlined headings (=== or ---) are ignored. Closing hashes are removed, but inline markup such as **bold** stays in the title.
      • Anchors keep letters and digits in any script and follow the GitHub rule. Other platforms make anchors in their own way, so test the links where you publish.
      • The links do not jump inside the Preview view, because the rendered headings have no ids. The tool does not warn about skipped levels or several H1s: you read those from the outline yourself.

      When to use it

      • Make a TOC block for a README or docs page.
      • Check heading depth before the final editorial review.
      • Spot skipped heading levels by reading the H labels in the Outline view.
      • Copy the markdown TOC into a changelog or release page.