★ Sentence-Based chunking, visualized
Sentence-Based Chunking for RAG
Sentence chunking first splits the text into sentences, here with the browser's built-in sentence segmenter, then packs whole sentences into chunks until the next one would exceed the size limit.
- Runs in your browser
- No signup
1,181 characters · loading tokenizer… · nothing leaves your browser
Sentence · 300 chars · overlap 60
6 chunks
- 54
- avg tokens
- 29 / 71
- min / max
- 28
- overlap tokens
- $6.50
- embed 1M docs
Loading the tokenizer; token counts are estimates until it's ready.
one chunkoverlapClick a chunk to inspect it.
Chunk inspector
Click any coloured chunk in the document to see its text, size, heading path and what it shares with its neighbours.
Chunk sizes
Tokens per chunk (estimated). A tight cluster means predictable chunks.
Embedding cost assumes text-embedding-3-small at $0.02 per 1M tokens (OpenAI, checked 8 Nov 2026), counting overlap twice.
Export config
Copy-ready code for the strategy and settings above. Comments flag where a library differs.
from langchain_text_splitters import NLTKTextSplitter
# pip install nltk, then: python -m nltk.downloader punkt_tab
# Packs whole sentences up to chunk_size (characters). Overlap is applied to the merged pieces.
splitter = NLTKTextSplitter(chunk_size=300, chunk_overlap=60)
chunks = splitter.split_text(text)Your retrieval is only as good as your chunks.
I build RAG systems with evals, so you know when the answers get better or worse.
How it works
Sentence chunking first splits the text into sentences, here with the browser's built-in sentence segmenter, then packs whole sentences into chunks until the next one would exceed the size limit.
Overlap is done in whole sentences: the last sentences of a chunk that fit in the overlap budget are repeated at the start of the next one. No chunk ever starts or ends mid-sentence.
When to use it
Good fit
- Prose where each sentence carries a complete fact: policies, FAQs, articles.
- When readable chunks matter, for example when you show retrieved text to users.
- Question answering over documents without much heading structure.
Watch out for
- One very long sentence becomes one oversized chunk (flagged in the tool).
- Abbreviations and numbered lists can confuse sentence detection.
- Ignores headings, so context from the section title is lost.
Where to start
Pack enough sentences to hold one idea, often a short paragraph, and overlap by one sentence. Check a few oversized chunks to see whether your text has run-on sentences or lists.
Then test it: write down twenty real questions, check which chunks come back for each, and compare strategies on the same set. The main visualizer lets you put two strategies side by side.
Questions engineers actually ask
How are sentences detected?
What happens to a sentence longer than the chunk size?
Is sentence chunking better than recursive?
What chunk size should I use for RAG?
Does my text leave the browser?
Other strategies
More from the workbench
Fine print
Tools: on the house.
Engineer: by the hour.
The visualizer was free. Production RAG with evals is what I build.
I'm Himanshu, an AI and full-stack engineer. I build MVPs, AI agents and the growth plumbing around them for early-stage startups.
