Document Splitter
Break a long Markdown or HTML document into one file per top-level section. Runs in your browser; nothing is uploaded.
About this tool
Document Splitter breaks a long Markdown or HTML document into separate files — one per top-level section. Paste a document, pick its format, and get back a suggested filename, title, and content for every section.
- Markdown splits at the smallest heading level present. If your document
uses
#for top-level headings, it splits on every#; if it only uses##, it splits on every##. - HTML splits at the smallest
<hN>tag present (e.g. every<h1>). - Any text before the first heading becomes an
introsection, so nothing is lost. - Filenames are numbered and slugified from each heading (e.g.
01-introduction.md), so they sort in document order and never collide.
Everything runs locally in your browser via WebAssembly — your document is never uploaded.
Common uses
- Break a book chapter, spec, or README into per-section pages for a static site.
- Turn one long Markdown export into individual notes.
- Chunk documentation ahead of importing it into a wiki or CMS.
FAQ
How does the tool decide which heading level to split on?
It scans the whole document and splits at the smallest heading level
actually present. A document with # headings splits on every #; a
document that only ever uses ### splits on every ###. HTML works the same
way with <h1>–<h6> tags. You can't force a deeper split level directly —
but you can run a single extracted section back through the tool.
What happens to content before the first heading?
It isn't dropped: any preamble becomes its own section titled intro, with a
filename like 01-intro.md, so the split output always reassembles into the
full original document.
Can two sections with the same title overwrite each other?
No. Filenames are built as NN-slug.ext (numbered in document order), and if
two sections would still slugify to the same name the later one gets a numeric
suffix — so every section is guaranteed a unique filename.
Does it understand headings inside code blocks?
Not specially — a line starting with # inside a fenced code block (say a
shell comment) is treated like any other Markdown heading and will start a new
section. If your document contains such code, split it as HTML after
rendering, or adjust the comment lines first.
Developer & Automation Access
Run it from the terminal
Same engine as this page, headless — via the gizza CLI:
gizza tool document-splitter "# First section
Some text…
# Second section
More text…"New to the CLI? Get gizza →
Open it by URL
Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:
https://gizza.ai/tools/document-splitter/?document=%23%20First%20section%0ASome%20text%E2%80%A6%0A%0A%23%20Second%20section%0AMore%20text%E2%80%A6&format=markdownMachine-readable descriptor: tool.json — title + parameters JSON Schema for agents.
