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

Chunk a Markdown File for AI Context Windows

Split a long document into size-limited parts so each chunk fits a model context window or a RAG index entry. Size is set in characters, with an approximate token count shown.

Direct answer

Use Split mode and choose 'By size'. Set a target size in characters. The tool breaks the document at paragraph boundaries where it can, so a chunk does not end mid-sentence, and shows each part's character count with an approximate token estimate of about four characters per token. Copy each chunk into a chat, or paste them one at a time into a RAG ingestion step.

Open Merge & Split Markdown tool

When to use this

  • A document is longer than the model's context window.
  • You are building a retrieval index and need consistent chunk sizes.
  • Long pastes get truncated in a chat interface.

Steps

  1. Open the tool and select the Split tab.
  2. Paste the document or load a .md file.
  3. Choose 'By size' and set the character target, for example 6000.
  4. Check the part list: each row shows the character count and the estimated tokens.
  5. Copy or download each part in order.

Example conversion

Input
A 20,000 character architecture document, split at a 6,000 character target.
Result
Part 1 — 5,842 chars (~1,460 tokens)
Part 2 — 5,910 chars (~1,478 tokens)
Part 3 — 5,733 chars (~1,433 tokens)
Part 4 — 2,515 chars (~629 tokens)

Common mistakes

  • The token number is an estimate from character count, not a real tokenizer result. Leave headroom before a hard model limit.
  • Size splitting ignores document structure beyond paragraph breaks, so a heading and its body can land in different chunks. Split by heading first if section boundaries matter more than even sizes.
  • Very small targets produce many parts and each one loses surrounding context. Prefer the largest size the model accepts.

FAQ

How accurate is the token estimate?
It uses roughly four characters per token, which is close for English prose and less accurate for code, other languages, or heavy punctuation. Treat it as a guide, not a limit.
Does the tool overlap chunks?
No. Parts do not overlap. If your retrieval setup needs overlap, add it after copying the parts.
Is the document sent to a server?
No. Splitting runs in your browser. This matters for internal documents, which is a common reason people chunk text.

Related merge and split guides