Splitting every N characters is the obvious approach and produces chunks that mean nothing on their own — a sentence cut in half, a heading orphaned from what it introduced. This breaks on the largest structural boundary that still fits: headings, then paragraphs, then sentences, and only mid-word when a single unit is too big to fit at all. Overlap carries a tail of each chunk into the next, so a fact spanning a boundary survives somewhere intact. What that overlap costs is shown as a percentage, because it is real duplication and worth seeing before it turns into an embedding bill.
Features
Breaks on headings, paragraphs or sentences rather than a fixed width
Sentence splitting that survives abbreviations and initials
Oversized units split at a word boundary rather than mid-word
Overlap carries context into the next chunk
Reports what the overlap costs as a percentage
Records the heading each chunk sits under
Size distribution: smallest, average and largest
Exports as JSONL with the heading and token count per chunk
How to use the Text Chunker
Drop in a document, or paste it
Choose what to break on
Set the target size and how much overlap you want
Step through the chunks, then export as JSONL
Example
Input
## Eligibility\n\nAn order is eligible if…
Output
chunk 2 — under “Eligibility”, ≈58 tokens
Breaking on headings keeps each section whole and labelled.
Common errors & troubleshooting
Chunks come out much smaller than the target. — A structural boundary was hit first. Breaking on paragraphs will not merge two paragraphs past the limit, so a document of short paragraphs produces short chunks.
One chunk is far larger than the rest. — A single unit bigger than the target is split at a word boundary, not merged. A long table or code block is the usual cause.
The overlap cost looks high. — It is a real duplication of tokens. Overlap is worth having, but a tenth of the chunk size is usually plenty.
Sentences split in odd places. — Abbreviations and initials are handled, but unusual punctuation will still catch it out. Paragraph granularity avoids the question entirely.
Frequently asked questions
What size should chunks be?
It depends on what reads them. Retrieval usually wants chunks small enough to be specific and large enough to stand alone — a few hundred tokens is a common starting point, then tune against real questions.
How much overlap do I need?
Enough that a sentence spanning a boundary appears whole somewhere. Around a tenth of the chunk size is typical; the cost of more is shown as a percentage so it is a visible trade-off.
Which boundary should I break on?
Headings when the document has them — each chunk then covers one section and carries its title. Paragraphs for ordinary prose. Sentences when you need finer control and can accept losing paragraph structure.
How exact are the chunk token counts?
They are character-based estimates with an adjustable ratio, because the ratio varies by language and script. For sizing chunks that is enough; for billing, count with the provider's own tokeniser.
Why does each chunk record a heading?
Because a chunk retrieved on its own has lost its context. Keeping the heading means the text arrives with a label saying what it is about, which improves what is done with it.
Related tools
Context Window Planner — Budget a context window across prompt, tools, history and the reply.