Document chunk splitter
Retrieval-augmented generation (RAG) answers a question by first finding relevant passages and then handing them to a language model. Documents are too long to search and pass around whole, so they are split into chunks first, and the chunks are what gets indexed, retrieved and read.
9 chunks, and every one ends at a sentence or line break.
How to split it
2,307 of 20,000 characters. Your text stays in this page: it is not sent anywhere or added to the link.
Tries paragraph breaks, then line breaks, then sentence ends, then spaces, going further only for pieces still too long. Then packs pieces into chunks.
The most repeated from the previous chunk, in whole pieces, so often less.
- Chunks 1, 3, 5 and chunks 2, 4, 6 alternate
- Striped and underlined: text in two or more chunks
- 3 where chunk 3 starts; mid-sentence where a chunk is cut
What it shows
Where you cut a document changes what a search can find. Cut in the middle of a sentence and a chunk can lose the very fact a question needs. Make chunks too big and that fact gets lost among unrelated text. Overlap copies the end of each chunk to the start of the next, so a fact near a cut still appears whole at least once.
The tool shows four ways to split: by a fixed number of characters, by a fixed number of words, at natural breaks (paragraphs first, then lines, then sentences), and by whole sentences. Your text stays on this page; only the settings go in the link.
How to read it
- Alternating shades are chunks; a dark badge marks where each one starts.
- Striped, underlined text is overlap.
- A red “mid-sentence” label marks a cut inside a sentence.
- Bars show each chunk’s size against the limit; striped bars were cut mid-sentence.
- Recursive and sentence chunks overlap by whole pieces, so overlap can be smaller than you set, or zero.
Questions
What chunk size should I use?
There is no single right size. It depends on your embedding model’s input limit, the kind of questions people ask, and how many chunks you pass to the model at once. Small chunks match narrow questions well but lose context; large ones keep context but dilute the match. Test a few sizes against real questions and measure what gets retrieved.
Why use overlap?
A fact that straddles a chunk boundary is split in two, and neither half may match the question. Overlap repeats the end of each chunk at the start of the next, so text near a boundary appears whole in at least one chunk. The cost is more chunks to embed and store, and near-duplicate results at retrieval time.
Is the recursive strategy the same as LangChain’s recursive splitter?
It follows a similar idea but is our own algorithm. LangChain’s RecursiveCharacterTextSplitter tries the separators “\n\n”, “\n”, “ ” and “” in order by default and measures length in characters. This tool adds a sentence level between lines and spaces and overlaps by whole pieces. Expect similar shapes, not identical chunks.
Why count words instead of tokens?
Each model has its own tokenizer, and shipping one would make this page much heavier. Words are a rough stand-in: a tokenizer may split one word into several tokens, especially rare words, numbers, code and text in other languages. Check your chunk sizes with your model’s tokenizer before relying on a limit.
How does the tool decide a chunk ends mid-sentence?
A chunk ends cleanly if its last character is . ! ? or …, optionally followed by a closing quote or bracket, or if a line break or the end of the text follows it. Anything else is flagged. Abbreviations such as “e.g.” can fool it, and the sentence splitter treats them as sentence ends too.
Sources
Explore further
- ChonkieOpen-source chunking library for RAG, with token, sentence, recursive and semantic chunkers.
Last updated
More tools
All tools- estimatorLLM cost estimatorCost per request and per month across LLM APIs, with caching, batch pricing and routing.Open tool
- estimatorAgent run cost estimatorCost of an agent run by model, steps and prompt caching, with context growth and the step where the window fills.Open tool
- estimatorVector index memory plannerRAM for a vector index by type, element size and replicas, with a breakdown of vectors, links, ids and codebooks.Open tool