ChatCraft

RAG Text Chunking & Token Overlap Visualizer

Interactive developer utility for comparing Fixed-Window, Recursive Paragraph/Sentence, and Markdown Heading-Aware text splitters before vector embedding. Adjust target character limits and sliding context overlap to inspect token overhead and boundary preservation.

How Chunk Size and Sliding Overlap Determine RAG Retrieval Accuracy

Embedding models compress an entire passage into a single fixed-width vector. Overly broad passages dilute cosine similarity across unrelated topics, whereas overly narrow chunks without sliding overlap sever conditional exceptions from the rules they modify.

Splitting StrategyRecommended WindowPrimary AdvantageFailure Mode to Watch
Fixed Character Window500–800 chars (15% overlap)Predictable memory footprint on unformatted OCR dumps.Splits mid-sentence and detaches Markdown table headers.
Recursive Paragraph / Sentence1,200–2,200 chars (10–15% overlap)Preserves natural grammar while bounding token budgets.Subheadings may trail the prior chunk unless heading-prefixed.
Markdown Heading Aware (H2/H3)Section-bounded up to 2,400 charsKeeps each FAQ or policy section self-contained with its header.Requires secondary recursive fallback on sections exceeding 800 tokens.

Read our companion architectural walkthrough in Semantic Text Chunking Strategies for RAG.