RAG Chunk Visualizer

Split text into retrieval chunks with four classic strategies — fixed, recursive, sentence-aware and exact token-based — and see exactly what your embeddings will ingest. 100% in your browser.

Source Text

Chunking Controls

Tune the strategy, size and overlap — the unit depends on the strategy (chars)

Statistics

0Chunks
0Total tokens
0Min
0Avg
0Max
Recursive separators

About this strategy

Splits on paragraph, then line, then sentence part, then space — the default in LangChain-style pipelines. Keeps natural boundaries intact for prose.

About token counting:

Token counts use the cl100k encoding (GPT-4 family) running locally via js-tiktoken. Embedding models use different tokenizers, so treat counts as a close approximation. Your text never leaves the browser.

How to Use the Tool

Chunking strategy is the hidden variable behind RAG quality: it decides what each embedding represents. This tool makes the splitting visible so you can tune size, overlap and strategy against your actual corpus.

  1. Load your text: Paste it, or upload a .txt/.md file — everything stays in your browser.
  2. Pick a strategy: Recursive for prose, fixed for structured text, sentence for precision, exact tokens for billing alignment.
  3. Tune size and overlap: Watch the distribution: tight min/max spreads mean uniform chunks, which usually retrieve more predictably.
  4. Export the chunks: Download the JSON payload — index, offset, tokens and text per chunk — ready to feed your embedding pipeline.

Frequently Asked Questions (FAQ)

What chunk size should I use for RAG?

There is no universal number, but 256-512 tokens is the common starting range for prose Q&A: small enough to keep embeddings focused, large enough to carry context. Test against your own retrieval evals — the right size depends on how dense your documents are.

Why does overlap matter?

A split can cut a sentence or a table row in half. With overlap, the boundary content appears complete in the neighboring chunk, so at least one embedding represents it whole. Typical values are 10-20% of the chunk size.

Which strategy matches LangChain's default?

Recursive separators mirrors RecursiveCharacterTextSplitter, the LangChain default: it tries paragraph breaks first, falls back to lines, then sentence parts, then spaces — preserving natural boundaries as much as possible.

Is my document uploaded anywhere?

No. Splitting, tokenization and visualization all run in JavaScript in your browser, and the JSON export is generated locally. There are zero network calls.

Share this tool