RAG chunking visualizer
See exactly how your documents get chunked before you embed them. Paste text, set chunk size and chunk overlap in tokens, switch between chunking strategies, and watch the chunk boundaries, token counts, and embedding cost update live — all in your browser.
Total tokens
1,800
Chunks
4
Avg tokens / chunk
498
One-time embedding cost
$0.00004
Chunk spans across the document
Alternating colors are consecutive chunks; the dark bands are overlap regions embedded in both neighbors.
Chunk 1
512 tokens
Driftdesk is a shared-inbox and help-center platform for support teams of two to two hundred. Every conversation — email, chat widget, or contact form — lands i…
Chunk 2
512 tokens
adds the chat widget, the full automation engine, reporting dashboards, and unlimited inboxes. Scale adds SAML single sign-on, the audit log, custom data reten…
Chunk 3
512 tokens
it enters a warning state visible in the queue, and when the target is missed, the breach is recorded on the conversation and in reporting. Targets pause autom…
Chunk 4
456 tokens
customer leaves a poor rating with a comment. Survey frequency is capped per customer so a person with five conversations in a week is only asked once. Everyt…
Token counts use the GPT tokenizer family; other models' tokenizers differ by roughly ±10–20%. Embedding cost is computed on embedded tokens — chunk tokens including overlap — so it grows as you raise the overlap.
How chunk size and overlap shape retrieval
Chunk size sets the trade-off at the heart of RAG: small chunks (128–256 tokens) embed a single focused idea, so similarity search matches precisely but may retrieve a passage stripped of the context needed to answer; large chunks (512–1,024 tokens) keep context together but dilute the embedding across several topics, which blurs retrieval and stuffs more tokens into every prompt. Chunk overlap hedges against the boundary problem — a sentence that answers the question but sits astride a split gets embedded whole in at least one chunk. The cost is duplication: at 512-token chunks with 64-token overlap you embed roughly 14% extra tokens, and the same passage can come back twice at query time. Most production RAG pipelines land at 256–512 tokens with 10–20% overlap, then tune from there against real queries.
Strategy matters as much as size. Fixed-size token chunking is predictable and cheap but happily cuts mid-sentence, which is exactly what overlap exists to patch. Sentence-aware chunking packs whole sentences up to the token budget, so every chunk reads as coherent prose — usually worth it for help-center articles, policies, and documentation. The recursive character splitters most frameworks default to (e.g. LangChain's RecursiveCharacterTextSplitter) approximate sentence-aware packing: they try paragraph, then sentence, then word boundaries before falling back to raw character splits. Chunking is a one-time embedding cost — the recurring spend is the retrieved context you send with every query, which you can estimate with our LLM API cost calculator.
More free tools
- LLM price comparison — Live table of every model's API prices — sort, filter, and cost out your own request size.
- LLM cost calculator — Estimate per-request, daily, and monthly spend from token counts and request volume.
- RAG cost calculator — Full pipeline costs — embeddings, vector storage, and generation — from corpus size and query volume.
- LLM context window comparison — Count the tokens in any text and check which models it fits, against live context windows.
- Tool call & MCP schema builder — Build function-calling parameters once, copy valid JSON Schema for OpenAI, Anthropic, and MCP.
- AI chatbot ROI calculator — Turn ticket volume, handle time, and deflection rate into monthly support savings and ROI.