Chunking strategy comparison
Paste your own text, pick a target size and an overlap, and see how three real splitting strategies cut it differently — including how often each one slices a sentence in half, and whether overlap actually stitches it back together in the next chunk (checked, not assumed).
Settled on a setting? chunk_size and chunk_overlap below map directly onto LangChain's real splitters — copy the config or the chunks themselves.
Each chunk after the first repeats this many characters from the end of the one before it — shown highlighted below. Turned up here so the effect is visible; real pipelines typically use less (10–20% of chunk size).
Fixed-size
Cuts every N characters. Fast, predictable, blind to content.
7
Chunks
6
Mid-sentence cuts
5/6
Recovered by overlap
180–270 chars, avg 252
CharacterTextSplitter(chunk_size=180, chunk_overlap=90, separator="")Recursive
Tries paragraph breaks, then sentences, then words, before a hard cut.
11
Chunks
3
Mid-sentence cuts
0/3
Recovered by overlap
75–270 chars, avg 175
Every cut here is a single sentence longer than the whole chunk — overlap can't repair that (it would need to repeat almost the entire previous chunk). A bigger chunk size would fix this; more overlap won't.
RecursiveCharacterTextSplitter(chunk_size=180, chunk_overlap=90)Sentence-packed
Packs whole sentences up to the target size. Never cuts one in half.
8
Chunks
0
Mid-sentence cuts
0/0
Recovered by overlap
102–306 chars, avg 227
No mid-sentence cuts here, so there's nothing for overlap to repair — the repeated text below is still applied, just with nothing broken to fix.