Document Splitter

Break a long Markdown or HTML document into one file per top-level section. Runs in your browser; nothing is uploaded.

Sections

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.

Everything runs locally in your browser via WebAssembly — your document is never uploaded.

Common uses

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=markdown

Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.