Kharabeesh
On-device ع

Markdown TOC & Formatter

Create a linked table of contents for a Markdown file or README and update it in one click, and tidy headings, lists and blank lines consistently.

Free, no sign-up Your data stays on your device Works offline after first open

The tool

Loading the tool…

How to use

  1. Paste or open a Markdown file.
  2. Choose “Table of contents” and the heading levels, or “Tidy file”.
  3. Copy the result or download a .md file. After editing, run it again and the table updates in place.

Privacy & how it works

Processes your data in the browser and stores nothing.

  • Engine: lightweight in-page code, no external libraries.
  • Works offline after you open it once.

Frequently asked questions

How are heading links made?

The GitHub way: lower case, punctuation removed, spaces become “-”, Arabic letters kept. A repeated heading gets -1, then -2. So links work on GitHub, GitLab and most editors.

Where does the table go?

If the file has <!-- toc --> and <!-- tocstop -->, the part between them is replaced. Otherwise it goes after the first main heading, or at the top, with both markers for the next update.

What does “Tidy file” change?

One space after # in headings, a blank line around headings, “-” for all bullets, renumbered ordered lists, no trailing spaces and no extra blank lines. Code blocks are left untouched.

Related tools