Need AI Training/Help?CloudYeti.io/meet
MarkdownMe
Merge and split Markdown guide

How to Split a Long Markdown Document by Heading

Paste one large Markdown document, choose H1 or H2 as the break point, and get one part per section with its own copy and download button.

Direct answer

Switch the tool above to Split mode, paste the document or load one .md file, then choose 'Split by H1' or 'Split by H2'. Every line that starts with the chosen heading level begins a new part, and the heading stays at the top of its part. Each part gets a copy button and its own download button. There is no zip download, so parts are saved one at a time.

Open Merge & Split Markdown tool

When to use this

  • One handbook file has grown too long to edit comfortably.
  • You want one page per section for a static site generator.
  • A single spec needs to be shared as separate documents with separate owners.

Steps

  1. Open the tool and select the Split tab.
  2. Paste the document, or load a single .md file from disk.
  3. Choose 'By H1' or 'By H2' as the split mode.
  4. Review the parts list. Each part shows its heading and its character count.
  5. Copy a part, download it, or press Copy all to take everything at once.

Example conversion

Input
# Handbook

Welcome.

## Onboarding

Day one checklist.

## Security

Use the password manager.
Result
Part 1 — Handbook
# Handbook

Welcome.

Part 2 — Onboarding
## Onboarding

Day one checklist.

Part 3 — Security
## Security

Use the password manager.

Common mistakes

  • Text before the first heading becomes its own leading part. Move front matter or an intro under a heading if you do not want a stray part.
  • A `#` inside a fenced code block is not a heading. Check parts that look wrong for code fences that contain shell comments.
  • Splitting by H1 in a document with one H1 returns one part. Use H2 for a document with a single title.

FAQ

Does the heading stay in the part?
Yes. Each part starts with its own heading line, so a part is a valid standalone document.
Can I download every part at once?
No. A zip download would need a compression library, which this tool does not include. Use the per-part download buttons, or Copy all to take the full set as text.
What happens to content before the first heading?
It is kept as the first part rather than discarded, so nothing is lost.

Related merge and split guides