RAG Cost Calculator
Estimate token counts and embedding costs for your documents in seconds.
-
1Enter data
Enter content, paste text or load a file from disk. -
2Click the button
The tool will immediately process your data in the browser. -
3Get the result
Copy the finished text or save the file to your device.
return "Result ready in 0.1s";
}
Rate this tool:
Related tools
Other tools you may find usefulHow to Use the RAG Cost Calculator
The RAG cost calculator answers one specific question: how much you will pay to prepare embeddings for your documents. The tool runs in your browser and, on this page, it does not fetch or send any data over the network, so you can enter your own numbers freely.
You need four values to run the calculation:
- Documents — how many documents are going into your knowledge base (5,000 by default),
- Chunks per doc — how many pieces you split each document into (20 by default),
- Embedding rate per 1M tokens — the price from your provider's pricing page ($0.02 by default, editable field),
- Tokens per chunk — the average length of one piece (350 by default).
The tool first works out the total number of tokens across the documents you plan to embed, then converts that figure into millions and multiplies it by your rate. You get two values: Total tokens and Embedding cost.
With the default values: 5,000 × 20 × 350 = 35,000,000 tokens, or 35M, and 35 × $0.02 = $0.7. The result is 35M and $0.7. Amounts are shown in the platform currency ($), but since you enter the rate yourself, you can calculate in any currency you like.
How to Estimate Document Chunks and Tokens
Chunk count and token count are the two parameters that move your result the most. It is worth spending a moment on them instead of typing in the first numbers that come to mind.
Chunks. A chunk is a piece of a document that goes into the knowledge base as a separate entry. Overly large chunks blend several threads together; overly small ones lose context. In practice, splitting by paragraph or section works well, sometimes with a small overlap so that neighboring chunks connect in meaning — just remember that overlap increases the number of chunks, and therefore the cost.
- Take 5–10 documents that are typical of your set.
- Split them the way you plan to split them in your RAG system.
- Count the resulting pieces and divide by the number of documents — that gives you the average number of chunks per document.
- Add up the tokens in those pieces and divide by their number — that gives you the average tokens per chunk.
Tokens. A token is the smallest unit of text that a model breaks text down into. One word is usually one to two tokens, and how far a given text stretches depends on the language and the tokenizer. The safest approach is to measure a sample with the counter your model provider offers and plug that result into the calculator.
What the Embedding Rate per 1M Tokens Means
The embedding rate per 1M tokens is the price you pay to turn a million tokens of text into vectors. In the calculator it defaults to $0.02 and you can change it freely — it is an approximate figure, not the current pricing of any platform.
Why is it worth checking? Because embedding model prices differ between providers and change over time, and the final bill is also shaped by factors such as the model you pick, your region, or the terms of your contract. Look up the current pricing from the provider you intend to use and enter that rate in this field.
The relationship is linear: twice as many tokens means twice the cost, and a rate that is half as high gives a result that is twice as low. That makes it easy to compare scenarios — larger chunks, for example, or a different embedding model — without changing your other assumptions.
Because you enter the rate by hand, you can run the calculation in any currency: just make sure all amounts use the same unit. By default, the tool displays US dollars.
Limitations: What the Calculator Does Not Cover
The calculator answers only one question: the cost of embedding your documents. Everything that happens later in a RAG system has to be added separately:
- the cost of queries to the model, meaning the conversion of user questions into vectors,
- the cost of generating answers with a language model,
- vector database costs: storage, maintenance, and operations on vectors,
- the cost of searching for similar chunks,
- the cost of re-indexing documents after they change or after you switch models,
- infrastructure, labor, taxes, fees, and commissions,
- currency exchange rates, plus any individual discounts and billing terms.
The tool does not process files and does not care about document formats — it calculates from the numbers you enter. Treat the result as a budget estimate and a starting point for a conversation with your provider, not as a binding quote. The actual invoice may differ if the project involves extra elements or different rates than the ones you entered.
How to Extend the Calculation to LLM and Vector Database Costs
Embedding costs are usually only part of the budget. If you want the full picture, break the calculation into several line items and price each one separately.
| Item | How to calculate it |
|---|---|
| Document embeddings | tokens ÷ 1,000,000 × rate — the result from this calculator |
| Query embeddings | queries per month × tokens per question ÷ 1,000,000 × rate |
| Answer generation | queries × input tokens (question plus context from the knowledge base) ÷ 1,000,000 × input-token rate, plus output tokens separately |
| Vector database | number of vectors (usually one per chunk) and how your provider bills — for storage and for operations |
Example: 10,000 queries per month, each using an average of 2,000 input tokens — that is 20M input tokens. Multiply that number by your rate per 1M tokens and add the cost of output tokens.
Three practical tips. First, round your assumptions up — context pulled from a knowledge base is usually longer than it looks. Second, remember that switching embedding models means recalculating all of your documents. Third, ask your vector database provider how it bills storage and search, because pricing models vary.
Frequently Asked Questions
What is a chunk in a RAG system?
A chunk is a piece of a document that goes into the knowledge base as a separate entry — for example a paragraph or a short section. It is from these pieces that the system retrieves the context it needs to answer a user's question.
How much does it cost to embed 5,000 documents?
With the default assumptions — 5,000 documents, 20 chunks per document, and 350 tokens per chunk — you get 35M tokens and $0.7 at a rate of $0.02 per 1M tokens. If your documents or your rate are different, enter your own numbers.
Does the RAG cost calculator send data to a server?
No. The tool runs in your browser and, on this page, it does not fetch or send any data over the network, so the values you enter stay with you.
Will the calculator also work out language model costs?
No, the tool calculates the cost of embedding documents only. Estimate the cost of queries and of generating answers with a language model separately and add it to the result.
What currency does the calculator use?
By default, amounts are shown in US dollars. When you enter your own rate, you can calculate in any currency — just make sure all amounts are in the same unit.
Do you pay the embedding cost only once?
You pay once for the first pass over your documents. If you add or change documents, or move to a different embedding model, they will have to be embedded again, which is another cost.
See also — related tools
Embedding rates are approximate and editable; before you decide, check the current pricing from your model/API provider.