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
- Paste or open a Markdown file.
- Choose “Table of contents” and the heading levels, or “Tidy file”.
- 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
Markdown Editor with Live PreviewWrite notes and reports in Markdown with an instant preview and automatic direction for each Arabic or English paragraph. The draft is saved in your browser; export .md or HTML, or print it.Markdown to HTML ConverterConvert Markdown into clean, sanitized HTML with a preview, automatic heading anchors and an option for a complete HTML page to copy or download.Table of Contents GeneratorPaste your headings (Markdown #, indentation, or numbering like 1.2.3) with optional page numbers and get a numbered multi-level table of contents with dot leaders. Copy as text, Markdown or HTML, or download Word.Text Cleaner (PDF Copy Fixer)Clean up text copied from PDFs: rejoin broken lines, remove extra spaces and invisible characters, and fix spacing around Arabic and English punctuation, with options for tatweel and tashkeel.