Choosing a Chunking Strategy for RAG by Looking at the Chunks
Fixed, sentence, paragraph, recursive or heading-aware chunking: how each one splits real documents, how to pick a size and overlap, and what to check.

Retrieval-augmented generation lives or dies by its chunks. The model can only answer from the pieces retrieval hands it, and retrieval can only find pieces that make sense on their own. Yet the chunking step is usually one line of code with a default size, chosen once and never inspected. Spending ten minutes looking at how your actual documents get cut is one of the cheapest quality improvements a RAG system can get.
What goes wrong with bad chunks
Chunks that are too small lose their subject. A piece that says refunds take 5 working days is useful; a piece that says within 5 working days after we receive the parcel, with the word refund in the previous chunk, is not. Chunks that are too large mix several topics, so their embedding sits vaguely between them and matches many questions weakly. Cuts in the middle of a list, a table or a sentence split the answer across two chunks, and retrieval often returns only one.
Repeated boilerplate is a quieter problem. Headers, footers and disclaimers that appear on every page create near-identical chunks that crowd real content out of the top results.
The main strategies
Fixed-size chunking counts tokens or characters and cuts, stepping back by the overlap for the next chunk. It is predictable and ignores structure. Sentence packing fills each chunk with whole sentences up to the limit. Paragraph packing does the same with paragraphs and only splits a paragraph when it is too long. Recursive splitting tries paragraphs, then lines, then sentences, then words, keeping the largest natural unit that fits, which suits mixed content with lists and code. Heading-aware splitting cuts Markdown at headings first, so no chunk crosses into another section, and records the heading path of each chunk.
See the boundaries
The RAG Chunking Simulator shows your own text with each chunk in its own colour and overlapping text in red. Load a few representative documents, pick a strategy and drag the size and overlap sliders. Watch where the cuts land. Did a heading end up alone at the end of one chunk while its paragraph starts the next? Was a numbered list split in half? Does each chunk read as a complete thought?
The chunk list shows every piece with its token estimate, character offsets and heading path. The stats tab adds a size histogram, the overhead that overlap adds, warnings for tiny and oversized chunks, and a list of near-duplicate chunks. The compare tab runs all six strategies at once so you can see chunk counts and size ranges side by side.
Sizes and overlap to start with
Many teams start between 200 and 500 tokens with 10 to 20 percent overlap. Short, factual documents such as FAQs suit the smaller end; long explanations suit the larger end. Overlap protects facts that sit near a boundary, but it also adds tokens to embed and store. Structure-aware strategies overlap by whole sentences or paragraphs, so the real overlap may be smaller than the setting, which is usually fine.
For Markdown documentation, heading-aware chunks with the heading path prefixed to each chunk are a strong default. The prefix, such as Returns policy then Faulty items, gives each chunk context it would otherwise lack.
Export and test
Export the chunks as JSONL, one line per chunk with its text, source, index, character offsets, token estimate and heading path. Then embed them with your model and test retrieval on real questions, ideally ones with known answers. If the right chunk does not come back, look at it in the simulator again. Token counts here are estimates, so leave some margin under your embedding model's limit.



