Calculators

RAG Chunking & Embedding Planner

Plan independent documents, compare chunking choices and see what your cost and context budgets actually include.

Saved only in this browser

Your document collection

Start with document boundaries, not one combined token stream.

Chunk boundaries restart for every document. Zero models an empty corpus.
A same-length document approximation, not the length of the whole corpus.
Last chunks are not padded. Actual short documents remain short.
Must be less than chunk size. No overlap is added between documents.
Token estimate0.75 words per token is an editable approximation, not a measured tokenizer result.
Each average document is rounded up to whole tokens separately. Language, code and document-length distribution change the result.
Embedding model and rateUSD per 1M input tokens. Reference prices and default dimensions are editable.

OpenAI text-embedding-3-small reference values checked 2026-09-12. Edit the rate, dimensions or limit for your configuration.

Entered input-token rate; excludes query embeddings, retries and discounts.
Default model length or your configured output length. Check provider support.
Per input text, not the chat context window or request batch limit.
Refresh and raw storage allowancesIncludes dense vectors, record IDs and metadata. Excludes a managed database's full bill.
Expected fraction of this initial ingestion, not a rounded document count.
Choose 1, 2, 4 or 8. Four models float32. A smaller format is not a guarantee of database support.
Include any stored chunk text here. Text size varies by encoding.
64 bytes is an editable example, not a vendor requirement.
0.33 is illustrative, not a current Pinecone or other vendor quote. Use your rate.
Answer context budgetRetrieval + query + instructions/history + reserved output. This does not price generated answers.
Capped by available chunks for this estimate only; your setting is not changed.
The current user query, counted once. No query-embedding cost is included.
Allow for system text, history, tool schemas and retrieved-source separators. Do not count the query twice.
Context allowance only, not a forecast of output length or cost.
Enter the window for your model/configuration. Its output limit is a separate check.
Load an exampleReplaces your numeric inputs and clears the optional comparison. Nothing is saved.

Local calculation; no documents, API keys or uploads needed.

Method, assumptions and limits

This is an independent-document planning model, not a tokenizer or semantic splitter. Every document is represented by the same average length. For mixed document lengths, run representative groups separately: rounding the average does not reproduce the sum of individually chunked real documents.

Count within each document, then scale

Let T = ceil(average words ÷ words per token), C = chunk cap and O = overlap. Stride = C − O. An empty document has zero chunks; otherwise chunks per document = 1 + ceil(max(0, T − C) ÷ stride). Total chunks = document count × chunks per document. Embedded tokens = document count × [T + O × max(0, chunks per document − 1)]. Final chunks are not padded, and no overlap crosses documents.

The default is 1,000 documents at 600 words each. At 0.75 words per token, each document is 800 estimated tokens and fits one 800-token chunk. The result is 1,000 chunks and 800,000 embedded tokens, with no repeated overlap. At $0.02 per 1M tokens, ingestion is $0.0160. With 1,536 dimensions × 4 bytes plus 1,024 metadata and 64 ID bytes per chunk, raw storage is 7,232,000 bytes, or 0.007232 decimal GB.

Separate a cost allowance from a vendor bill

One-time embedding = embedded tokens ÷ 1,000,000 × entered price. Monthly refresh repeats the selected fraction of that work. Raw bytes = chunks × (dimensions × stored bytes per dimension + metadata bytes + ID bytes). Decimal GB = bytes ÷ 1,000,000,000. A smaller storage format describes an assumption, not supported quantization or preserved retrieval quality.

The default $0.33 per GB-month is an illustrative allowance, not a current vendor quote. It gives $0.00238656 monthly storage and, with $0.0016 re-embedding, a $0.00398656 monthly subtotal. Managed indexes, reads, writes, backups, replicas, minimum spend, query embeddings, answer generation, rerankers, engineering and taxes are not included. Chunk text is included only to the extent you allow for it in metadata bytes.

Budget the whole answer request

Retrieval uses at most min(top-k, available chunks) × min(chunk cap, estimated document tokens). This is an upper bound within this average-document model, not the actual lengths of retrieved chunks from your corpus. Add the query once, instructions/history/wrappers and reserved output. Compare the sum to your chat model window. The displayed top-k cap is a token-budget ceiling, not a recommendation; reranking, deduplication, provider output limits and retrieval quality are not simulated.

Reference values checked 12 September 2026

OpenAI text-embedding-3-small ($0.02 per 1M input tokens) · OpenAI text-embedding-3-large ($0.13 per 1M input tokens). These are standard reference rates, not your account quote or a promise that discounts, batch or regional terms apply.

OpenAI embeddings documentation lists default dimensions of 1,536 and 3,072 and an 8,192-token maximum input for these two references. Reduced dimensions and real token counts must be checked for your configuration. Changing a reference field explicitly changes its status to custom.

Pinecone’s cost guide illustrates record sizing with IDs, metadata and four-byte dense dimensions. Its database billing also depends on operations and plan terms. This calculator generalizes the storage format as an editable assumption; it does not fetch or quote Pinecone pricing.

FAQ

Does this planner merge documents before chunking?

No. It models independent, equal average-length documents. It rounds the token estimate per document, applies fixed-window chunking within each document and then multiplies by document count. Unequal lengths and semantic splitters can produce different totals.

Why can overlap add no embedding cost?

A document that fits in one chunk needs no repeated boundary tokens. Overlap adds cost only between chunks of the same document. It is not charged between independent documents in this model.

Is the monthly subtotal a complete RAG bill?

No. It combines only the selected re-embedding fraction and a raw storage allowance. It excludes query embeddings, generation, database reads and writes, indexes, replicas, backups, reranking, minimum fees and taxes.

Does fitting the context budget prove the setup will work?

No. The budget reserves space for retrieval, query, instructions/history and an answer. Actual tokenizer counts, output limits, provider request limits and retrieval quality require separate validation.

Are my scenario inputs saved?

No scenario is saved or uploaded automatically. Copy this estimate deliberately produces text to retain or share. The existing pin control stores only a tool preference in this browser.