Skip to content

RAG Chunk Size Calculator

Recommend a RAG chunk size, overlap and chunking strategy from document type, query type and embedding model, with a context-window token budget.

RAG Chunk Size Calculator

Document profile

Recommendations

Chunk size 461 tokens, overlap 46 tokens, recursive strategy

Chunk size
461
tokens
Overlap
46
tokens
Strategy
recursive
chunking

Reasoning

  • - General text: balanced 512-token chunks with recursive splitting.
  • - Factual lookups work well with focused, smaller chunks.
  • - Final chunk size: 461 tokens with 46 token overlap (10%).
  • - Token budget: 2,305 tokens for 5 chunks.

Token budget breakdown

Remaining
0128,000 tokens
System prompt: 1,000
RAG chunks: 2,305
User query: 200
Response budget: 2,000
Remaining: 122,495

About the RAG chunk size calculator

This tool uses a rule-based decision tree to recommend optimal chunk sizes, overlap, and splitting strategies based on your document type, query patterns, and embedding model constraints. The token budget visualizer shows how your context window is allocated across system prompt, retrieved chunks, query, and response.

Updated . Provided as is. Check the output before you rely on it in production.

How to use RAG Chunk Size Calculator

  1. 1

    Describe your documents

    Pick the document type (technical docs, legal, source code, chat, research papers, product descriptions, FAQ or general text) and the average document length.

  2. 2

    Describe your queries

    Choose the query type (factual lookup, analytical, conversational or comparison) and how many chunks you retrieve (top-k).

  3. 3

    Pick the embedding model

    Choose the embedding model so the recommended chunk size stays within its input limit.

  4. 4

    Read the recommendation

    Get a chunk size, overlap and chunking strategy with the reasoning, plus a token budget for system prompt, retrieved chunks, query and response against your context window.

  5. 5

    Export

    Export the recommendation as Markdown for your design doc.

Questions and answers

What is the best chunk size for RAG?
It depends on your document type and query pattern. Technical docs typically work best at 256-512 tokens, conversational data at 128-256 tokens, and legal/research documents at 512-1024 tokens. This calculator provides specific recommendations.
What is chunk overlap and why does it matter?
Overlap is the number of tokens shared between adjacent chunks. It prevents information loss at chunk boundaries, where important context might be split. Typical overlap is 10-20% of chunk size.
Which chunking strategy should I use?
Recursive character splitting works well for most cases. Semantic chunking is better for documents with varied structure. Sentence-based works for FAQ and Q&A content. Paragraph-based is ideal for well-structured documents.
How many chunks should I retrieve (top-k)?
Start with 3-5 for factual lookup, 5-10 for summarization, and 8-15 for multi-hop reasoning. More chunks provide more context but increase cost and potential noise.
Does chunk size affect embedding quality?
Yes. Chunks that are too small lose context, making the embedding less meaningful. Chunks that are too large dilute the semantic signal. This calculator helps find the optimal balance for your use case.
For AI agents: how to call this tool

Machine-readable contract, endpoints and examples. Humans can ignore this section.

Best Path For Builders

Browser workflow

Runs instantly in the browser with private local processing and copy/export-ready output.

Browser Workflow

This tool is optimized for instant in-browser execution with local data handling. Run it here and copy/export the output directly.

/rag-chunk-calculator/

For automation planning, fetch the canonical contract at /api/tool/rag-chunk-calculator.json.