Skip to main content
kitlocal.dev

RAG Chunk Visualizer

Runs locally

100% processed in your browser. Inputs and outputs never leave your device.

See how a document is split into chunks for RAG: chunk size, overlap, token counts, embedding cost and retrieved context

Document

Like LangChain's RecursiveCharacterTextSplitter: tries to cut at blank lines first, then newlines, sentences and words, so chunks stay as semantic as possible.

Presets (size / overlap):
Chunks
3
Document tokens
232
Avg tokens / chunk
81
Min / max tokens
46 / 126
Tokens to embed
242
Overlap factor
1.04×

Estimated embedding cost: $0.000005

Context added to each prompt: 323 tokens

Document map (yellow = overlap with the previous chunk)

Alternating rows make neighbouring chunks easy to tell apart.

  1. #170 tokens280 characters0–280
    # Retrieval-Augmented Generation
    
    Retrieval-Augmented Generation (RAG) gives a language model access to knowledge it was not trained on. Instead of fine-tuning, you split your documents into chunks, embed each chunk, and store the vectors in a database.
    
    ## Why chunking matters
    
    
  2. #2126 tokens503 characters255–75825 chars overlap
    ## Why chunking matters
    
    At query time the question is embedded and the closest chunks are retrieved. If a chunk is too large, it dilutes the meaning and wastes context window. If it is too small, it loses the surrounding context and the answer gets cut in half.
    
    A common starting point is 256 to 512 tokens with 10 to 20 percent overlap. Overlap repeats the end of one chunk at the start of the next, so a sentence that straddles a boundary is still found whole in at least one chunk.
    
    ## Trade-offs
    
    
  3. #346 tokens184 characters743–92715 chars overlap
    ## Trade-offs
    
    Larger overlap improves recall but increases the number of tokens you embed and store. Always measure retrieval quality on your own questions before settling on a size.
    

Token counts are estimates (~4 characters per token for English, ~1 per non-Latin character), not the exact output of a model tokenizer. Costs depend on your provider's current price.