# Markdown Splitter > A free tool at https://markdown-splitter.skillsafe.ai/ that splits one long Markdown document into one file per section, plus an index.md, in the visitor's browser. Nothing is uploaded and no sign-up is needed for any result. How it works: - The visitor drops a Markdown file (.md, .markdown, .mdx or .txt; UTF-8, UTF-16 or Windows-1252) or pastes the text, or clicks one of three examples (a team handbook, a design doc with front matter, a story in chapters). - It splits at a heading level: Auto uses ## when there are at least two ## headings, otherwise # (chapters), otherwise ###; the visitor can choose #, ##, ### or ####. A # heading that appears once before the first section is the document title and stays in index.md. Headings inside fenced code blocks, HTML comments and YAML or TOML front matter never count. Both # style and underlined (setext) headings are read. - Each section becomes a file named after its heading in lower-case-with-hyphens (time-off.md); repeated headings get -2, -3. An option numbers the files 01-, 02- so they sort in reading order. - Each file's heading becomes a top-level # heading and the headings under it move up the same number of levels (optional). - Links between sections are re-pointed: [Expenses](#expenses) becomes [Expenses](./expenses.md), and a link to a sub-heading becomes ./file.md#anchor using GitHub-style anchors. Relative image and file paths get ../ because the files sit one folder deeper. Links to headings that do not exist are listed and left alone (optional). - index.md keeps everything before the first section (front matter, title, introduction) and adds a Contents list linking every file in reading order, nested when ## sections sit under # parts. - The page checks that the files join back into the original line for line, warns when one file still has more than half the words, and lists files that have only a heading. - Exports: a .zip holding a folder named after the source file, with index.md and every section; index.md alone; one file at a time; copy index.md or a file list. ## Optional AI step After sign-in, "Describe each file with AI" sends each file's name, heading, word count, sub-headings and the start of its text (about 24,000 characters in total, cut at sentence boundaries), plus an optional note, to the app's model (gpt-terra). It returns JSON: a one-sentence summary and a 3 to 10 word description per file. The page adds them to index.md and checks that every file is described once, that no unknown file is named, and that every figure appears in that file's text. Runs are metered in SkillSafe credits; the amount reserved is shown first. ## API https://markdown-splitter.skillsafe.ai/api.html documents the run input: {"task": "describe", "doc_title": "", "source_name": "", "split_at": "##", "note": "", "parts": ""}. ## Source Adapted from the agent skills @bmad-code-org/bmad-shard-doc (https://skillsafe.ai/skill/@bmad-code-org/bmad-shard-doc) and @bmad-code-org/bmad-index-docs (https://skillsafe.ai/skill/@bmad-code-org/bmad-index-docs) from bmad-code-org/bmad-method, MIT licence.