RAG · DOCUMENT PROCESSING COST

RAG Chunk & Embedding Cost Calculator

How much does chunk overlap add?
Calculate initial embedding and monthly re-embedding separately.

Documents & chunking

USD · before-tax estimate
RAG embedding cost inputs
Monthly re-embedding Default: 10% per run · 4 runs/month

No document text or API keys. Tokens are not characters. Assumptions & exclusions ↓ · Length-distribution study ↓

Results

OpenAI text-embedding-3-small

An overlap of 200 tokens adds 24% to processed tokens. Initial embedding costs $0.2480.

Total chunks

13,000items

13 per document · final chunk 400 tokens

Processed tokens

12,400,000

+2,400,000 tokens over the original text

Initial embedding cost

$0.2480

$0.02 per million tokens

Monthly re-embedding: 100 documents × 4 runs: $0.0992 · 4,960,000 tokens (initial cost separate)

Same chunk size, different overlap

Compare 0%, 10% and 20% overlap. This table does not recommend an overlap ratio or predict retrieval quality.

1,000 documents × 10,000 tokens · 1,000-token chunks
OverlapTotal chunksProcessed tokensInitial cost
0 tokens10,000 items10,000,000$0.2000
100 tokens11,000 items11,000,000$0.2200
200 tokens13,000 items12,400,000$0.2480

NANOBOOK ANALYSIS · CALCULATED

Does average document length give the right cost?

It can be low or high. In the long-tail example below, using the exact mean puts the initial embedding estimate 18.0% below the document-by-document calculation. The difference comes from rounding chunk counts separately for each document.

Illustrative token-length distributions, independent of the calculator inputs above. 1,000 documents · 1,000-token chunks · 200-token overlap · OpenAI text-embedding-3-small. Initial cost only, before tax; no real corpus or paid API test.

Same 1,000-token mean, different totalsProcessed tokens and initial embedding cost
Using the mean
$0.020000
1,000,000 tokens · 1,000 chunks
Document by document
$0.024400
1,220,000 tokens · 2,100 chunks

Averages hide document boundaries

The example contains 900 short documents of 100 tokens and 100 long documents of 9,100 tokens. Both methods start from the same 1,000,000 original tokens.

The average method creates 1,000 chunks. Splitting every document separately creates 2,100, adding 220,000 overlapping tokens that the average misses.

Load the uniform-average estimate

This link loads only the mean into the calculator. The document-by-document result stays in this study.

Three examples at 200-token overlap · error is measured against the per-document calculation
Document lengthsUsing the meanPer-document costError
Equal lengths1,000 × 1,000 tokensMean: 1,000 tokens$0.020000$0.020000Matches
Short majority, long tail900 × 100 + 100 × 9,100 tokensMean: 1,000 tokens$0.020000$0.02440018.0% low
Mean just above the boundary500 × 1,000 + 500 × 1,002 tokensMean: 1,001 tokens$0.024020$0.0220209.1% high

Group notation: document count × tokens per document. “Low” and “high” describe the mean-based estimate relative to the per-document calculation. These examples do not establish a typical error or a worst-case limit.

Zero overlap removes this token-cost difference

For the same long-tail corpus with no overlap, both methods process 1,000,000 tokens and cost $0.020000. Chunk counts still differ: 1,000 versus 1,900. A matching embedding cost does not establish matching vector counts.

Compare all distributions and overlap settings 15 cases

OpenAI text-embedding-3-small; six-decimal USD costs. Every pair lists the mean estimate first, then the per-document result.

Five synthetic distributions × 0/100/200 token overlap
CorpusOverlapChunks: mean / per docCosts: mean / per docError
Equal lengths1,000 × 1,000 tokens0 tokensMean: 1,000Per doc: 1,000Mean: $0.020000Per doc: $0.020000Matches
Equal lengths1,000 × 1,000 tokens100 tokensMean: 1,000Per doc: 1,000Mean: $0.020000Per doc: $0.020000Matches
Equal lengths1,000 × 1,000 tokens200 tokensMean: 1,000Per doc: 1,000Mean: $0.020000Per doc: $0.020000Matches
Balanced mix500 × 900 + 500 × 1,100 tokens0 tokensMean: 1,000Per doc: 1,500Mean: $0.020000Per doc: $0.020000Matches
Balanced mix500 × 900 + 500 × 1,100 tokens100 tokensMean: 1,000Per doc: 1,500Mean: $0.020000Per doc: $0.0210004.8% low
Balanced mix500 × 900 + 500 × 1,100 tokens200 tokensMean: 1,000Per doc: 1,500Mean: $0.020000Per doc: $0.0220009.1% low
Short majority, long tail900 × 100 + 100 × 9,100 tokens0 tokensMean: 1,000Per doc: 1,900Mean: $0.020000Per doc: $0.020000Matches
Short majority, long tail900 × 100 + 100 × 9,100 tokens100 tokensMean: 1,000Per doc: 1,900Mean: $0.020000Per doc: $0.0218008.3% low
Short majority, long tail900 × 100 + 100 × 9,100 tokens200 tokensMean: 1,000Per doc: 2,100Mean: $0.020000Per doc: $0.02440018.0% low
Across the first boundary500 × 999 + 500 × 1,001 tokens0 tokensMean: 1,000Per doc: 1,500Mean: $0.020000Per doc: $0.020000Matches
Across the first boundary500 × 999 + 500 × 1,001 tokens100 tokensMean: 1,000Per doc: 1,500Mean: $0.020000Per doc: $0.0210004.8% low
Across the first boundary500 × 999 + 500 × 1,001 tokens200 tokensMean: 1,000Per doc: 1,500Mean: $0.020000Per doc: $0.0220009.1% low
Mean just above the boundary500 × 1,000 + 500 × 1,002 tokens0 tokensMean: 2,000Per doc: 1,500Mean: $0.020020Per doc: $0.020020Matches
Mean just above the boundary500 × 1,000 + 500 × 1,002 tokens100 tokensMean: 2,000Per doc: 1,500Mean: $0.022020Per doc: $0.0210204.8% high
Mean just above the boundary500 × 1,000 + 500 × 1,002 tokens200 tokensMean: 2,000Per doc: 1,500Mean: $0.024020Per doc: $0.0220209.1% high
Method, formulas and limits

Let tᵢ be each document’s token length, D the document count, μ the exact mean, C the chunk size and O the overlap. A document has n(t) = max(1, ceil((t−C)/(C−O)) + 1) chunks. Stop when the last chunk reaches its document’s end; do not pad or join documents.

Per-document processed tokens = Σ [tᵢ + (n(tᵢ)−1) × O]

Mean estimate = D × [μ + (n(μ)−1) × O]

Difference = O × [D × n(μ) − Σ n(tᵢ)]

Signed error (%) = (mean estimate − per-document total) ÷ per-document total × 100

The raw token sums cancel because D × μ = Σ tᵢ. With positive linear per-token pricing, the relative token error is also the relative initial-cost error. That is why the percentages match across the three supported standard rates, while dollar costs differ.

  • All five distributions are synthetic and have exact integer means. This isolates per-document chunk rounding from any extra error caused by rounding a fractional average to fit the calculator’s integer input.
  • These are exact calculations for the specified lengths and fixed-window rule, not measured provider bills or results from a sentence, recursive or semantic splitter.
  • The same token counts are used for each price comparison; they do not imply that different model tokenizers produce the same counts for the same text.
  • Provider-added tokens, retries, truncation, free allowances, Batch discounts, tax, query embeddings, vector storage/search and generation are excluded. Per-chunk model limits are checked for every length group.
  • This study covers initial embedding only. Reprocessing cost also depends on which documents are selected. Average-estimate links set monthly reprocessing to zero; they do not load the heterogeneous distribution.

Cost is proportional to processed tokens at the published standard rate. The calculator displays four USD decimals; this study shows six and the CSV retains twelve. Error percentages use unrounded token totals.

Analysis checked . Prices and limits were checked against OpenAI small, OpenAI large, OpenAI input limits and Voyage pricing. Distribution comparisons are NanoBook calculations.

Official rates used

Checked · Standard embedding rates · before tax · free credits and Batch discounts excluded. USD per million input tokens.

Standard text embedding rates and per-input token limits
ModelStandard rateInput limit
OpenAI text-embedding-3-small ↗$0.028,192 tokens
OpenAI text-embedding-3-large ↗$0.138,192 tokens
Voyage voyage-4 ↗$0.0632,000 tokens

Voyage offers account-specific free token allowances, which are not applied here. OpenAI and Voyage Batch discounts are also excluded, so actual charges may differ. Verify your custom rate and provider limits separately.

What does this estimate assume?

Fixed token windows, split per document

For document length T, chunk size C and overlap O, chunks per document = max(1, ceil((T−C)/(C−O)) + 1). Stop when the final chunk reaches the document end. Do not pad it or join documents. Processed tokens per document = T + (chunks−1) × O.

Average length does not give an exact chunk count

Every document is assumed to have the entered length. Unequal lengths change rounding, chunk counts and costs. Use tokens counted by the model's tokenizer. Sentence, paragraph, recursive and semantic splitting, or the exact behavior of a library such as LangChain, are not reproduced.

Monthly cost covers re-embedding only

Documents per run = ceil(total documents × reprocessing percentage ÷ 100). Multiply by runs per month and processed tokens per document. Each selected document is embedded in full, with no incremental processing or deduplication. Initial embedding cost is not included in monthly re-embedding cost.

Other costs and automatic processing are excluded

Query embeddings, provider-added prompts or special tokens, retries, automatic truncation, vector storage/search, LLM generation, tax and currency conversion are excluded. Inputs above the limit produce an error rather than being truncated. Rates are public standard API prices, not subscription fees.

Calculator bounds: 1 million documents, 1 million tokens per document, 32,000 tokens per chunk and 1 trillion initially processed tokens. These are not provider request or batch limits. Costs are accumulated in integer units and displayed to four USD decimal places. A displayed $0.0000 can still be positive before rounding.

Sources & verification scope

Official model documentation, prices and input limits were checked on 2026-11-05. The chunk formula is derived from this tool's fixed-window assumptions. No paid API requests, billing verification or retrieval-quality tests were performed. Rates are normally rechecked monthly.

Operator: kim hyun · NanoBook · Report an error

Revision history · First published 2026-11-05. Includes standard official rates for three models, custom pricing, overlap comparison and monthly re-embedding estimates.

2026-11-05 · Added synthetic document-length comparisons, a per-document calculation method and reproducible CSV files. Standard prices and model input limits were rechecked; no paid API requests were made.