RAG Chunking and Embedding Cost Calculator
Work out how many chunks your documents become, what it costs to embed them once, and what retrieval costs each month. Set chunk size, overlap and prices; it runs in your browser.
Updated November 19, 2026
Documents and chunking
About 1.3 tokens per English word. Use the AI token counter for a sample.
Must be smaller than the chunk size.
Embedding model
Choosing a preset fills in an example price. You can edit it.
Example list prices checked 2026-11-19: OpenAI text-embedding-3-small pricing. Prices change; verify on the provider page.
Queries
Results
Formulas
- Chunks per document = 1 if tokens ≤ chunk size, else 1 + ⌈(tokens − chunk size) ÷ (chunk size − overlap)⌉
- Embedded tokens = (document tokens + overlap × (chunks − 1)) × documents
- Index cost = embedded tokens ÷ 1,000,000 × embedding price
- Query embedding cost = queries × question tokens ÷ 1,000,000 × embedding price
- Generation cost = queries × (input tokens × input price + answer tokens × output price) ÷ 1,000,000, where input tokens = retrieved chunks × average chunk size + question + system prompt
- Monthly query cost = query embedding cost + generation cost
How to use this RAG cost calculator
- Enter how many documents you will index and their average length in tokens.
- Set the chunk size and overlap you plan to use in your splitter.
- Pick an embedding model or type your own price per 1M tokens.
- Enter monthly queries and how many chunks you retrieve for each. Tick the generation box to add the answering model.
Worked example
10,000 documents of 3,000 tokens, with 512-token chunks and 64 tokens of overlap, give 1 + ⌈(3,000 − 512) ÷ 448⌉ = 7 chunks each, or 70,000 chunks. Embedded tokens are (3,000 + 64 × 6) × 10,000 = 33.84 million, so at $0.02 per 1M tokens indexing costs about $0.68 once. At 50,000 queries a month with 30-token questions, embedding the queries costs 50,000 × 30 ÷ 1,000,000 × $0.02 = $0.03.
Estimates only: vector database hosting, re-ranking, re-indexing and taxes are not included. To count tokens, try the AI token counter. For answering costs see the LLM API cost calculator, for speed the tokens per second calculator, and to compare running your own model, the self-host vs API calculator.
See also
- To size your chunks, paste a sample and count tokens in the AI tokens calculator.
Frequently Asked Questions (FAQ)
Each document gives 1 chunk if it fits in the chunk size, otherwise 1 + ⌈(document tokens − chunk size) ÷ (chunk size − overlap)⌉. Multiply by the number of documents. Overlap makes chunks repeat text, so more overlap means more chunks.
Embedded tokens = document tokens + overlap × (chunks − 1), per document, summed over all documents. Cost = embedded tokens ÷ 1,000,000 × the embedding price per 1M tokens. It is a one-off cost, paid again only when you re-index changed or new documents.
There is no universal best value. Common starting points are 256 to 1,024 tokens with 10 to 20% overlap. Smaller chunks are more precise but give more vectors and less context per hit; larger chunks cost more per query when sent to the generation model. Test retrieval quality on your own questions.
Embedding each question (queries × question tokens × embedding price) plus, if you enter generation prices, the model call: retrieved chunks × average chunk size + question + system prompt tokens as input, and the answer length as output.
Use the AI token counter on this site for a sample, then average. As a rough guide English text is about 0.75 words per token, so 1,000 words is around 1,300 tokens. Different embedding models tokenise differently, so treat counts as estimates.
Presets are example list prices with the date they were checked and a link to the provider page. Prices change, so edit the figures to match your own plan. Free allowances, batch discounts and caching are not included.
Vector database hosting and storage, re-ranking models, re-indexing, text extraction and chunking compute, and taxes. Those can matter more than embedding cost for large corpora.
Related Tools
- AI Token CounterCount tokens, words and characters in your prompts for GPT, Claude, Gemini and Llama.
- Tokens to Words, Pages and Books ConverterHow many tokens in a word, page or 1,000 words? Convert words, pages and books to tokens and back for six languages.
- LLM VRAM CalculatorEstimate how much GPU memory (VRAM) you need to run a local LLM, and which GPUs can run it.
- KV Cache CalculatorMemory per token and total KV cache from layers, KV heads, head dimension, context, batch and precision, with GQA and context-length views.
- LLM Tokens per Second CalculatorEstimate local LLM generation speed from GPU memory bandwidth, model size and quantization.
- Self-Host vs API Cost Calculator (LLM Break-Even)Compare monthly LLM API cost with self-hosting on a rented or owned GPU and find the break-even token volume. All assumptions shown.