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

Total chunks
70,000
7 per document
Index (embedding) cost
$0.68
one-off, 33,840,000 tokens (+12.8% from overlap)
Monthly query cost
$0.03
$0.03 embedding queries

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

  1. Enter how many documents you will index and their average length in tokens.
  2. Set the chunk size and overlap you plan to use in your splitter.
  3. Pick an embedding model or type your own price per 1M tokens.
  4. 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)

How many chunks will my documents produce?

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.

How is the embedding (indexing) cost calculated?

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.

What chunk size and overlap should I use?

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.

What is in the monthly query cost?

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.

How do I count tokens in my documents?

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.

Are the model prices up to date?

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.

What does this not include?

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.