---
title: "RAG chunking calculator: chunks, embedding tokens and cost"
description: "Work out chunk counts, embedding tokens, input tokens per query and the monthly LLM bill for a RAG system from document size, chunk size, overlap and top-k."
url: https://broadrouter.com/tools/rag-chunking-calculator/
lang: en
updated: 2026-11-16
publisher: BroadRouter (a BroadNet site); API by BroadNet Inference, https://inference.broadnet.ai
---

# RAG chunking calculator

Updated 2026-11-16

**In short:** Chunks per document = (document tokens − overlap) ÷ (chunk size − overlap), rounded up, and each query sends the system prompt, the question and top-k × chunk size as input. 1,000 documents of 5,000 tokens in 512-token chunks with 64 overlap make 12,000 chunks, and top-5 retrieval adds 2,560 input tokens to every query.

Free, no sign-up, runs in your browser: nothing you type is sent anywhere.

Corpus, chunking and trafficDocumentsSize of eachUnitpageswordstokensWords per pageContent typeEnglish prose (~1,290 tokens per 1,000 words)Modern Standard Arabic (~2,080 tokens per 1,000 words)French (~1,534 tokens per 1,000 words)Spanish (~1,429 tokens per 1,000 words)Python code (~2,126 tokens per 1,000 words)JSON (~4,359 tokens per 1,000 words)Chunk size, tokensOverlap, tokensTop-k chunks per querySystem prompt, tokensQuestion, tokensAnswer, tokensQueries per dayDays per monthCached input, %Share of input billed at the cached price

Chat model (answers)DeepSeek V4.1 FlashGLM 5.3Qwen3.8 27BBroadNet Gemma 4 VL 26BAnother provider's model (428 in our price database)…Custom prices

Search a model by name

Prices are each model's cheapest listed standard price, read from providers' own pricing pages (newest check 2026-11-15).

Input, per 1MCached input, per 1MOutput, per 1MContext window, tokens (optional)

Embedding price per 1M tokens (your provider)BroadNet sells no embeddings. Leave empty to skip embedding cost.

Chunks in the index

—

Tokens to embed

—

Input per query

—

LLM cost per month

—

Breakdown
| Item | Value |
| --- | --- |

[Get started](https://inference.broadnet.ai/account/?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-rag-chunking-calculator&utm_content=tool) ·

Estimates before tax. Word-to-token ratios are averages over five real tokenizers from our [open tokenizer dataset](https://broadrouter.com/data/tokenizer-efficiency/); count your own text for exact numbers. BroadNet prices synced 2026-11-14. Retrieval quality is not modelled: more or larger chunks cost more but do not guarantee better answers.

[Report a wrong price or number](mailto:info@broadnet.ai?subject=Wrong%20price%20or%20number%20on%20RAG%20chunking%20calculator&body=Page%3A%20https%3A%2F%2Fbroadrouter.com%2Ftools%2Frag-chunking-calculator%2F%0A%0AWhat%20looks%20wrong%20(model%2C%20figure%20shown%2C%20correct%20figure%20and%20a%20source%20link%20if%20you%20have%20one)%3A%0A) (email to info@broadnet.ai, with this page's link and your inputs filled in).

## How it works

1.  Enter the number of documents and the size of each in pages, words or tokens. For pages and words, pick the content type so words convert to tokens at measured ratios.
2.  Set chunk size and overlap in tokens, and top-k (chunks retrieved per query).
3.  Enter system prompt, question and answer tokens, queries per day and days per month. Pick the chat model and, optionally, your embedding provider's price per 1M tokens.
4.  Read the chunk count, tokens to embed, input per query, the context check and the monthly cost. Copy the link to share it.

## The formulas

```
doc tokens        = pages × words per page × tokens per word   (or words × tokens per word)
chunks per doc    = 1 if doc ≤ chunk, else ceil((doc − overlap) / (chunk − overlap))
tokens to embed   = docs × (doc tokens + (chunks per doc − 1) × overlap)
input per query   = system + question + top-k × chunk
monthly LLM cost  = queries × (input × input_price + answer × output_price) / 1,000,000
context check     = input per query + answer ≤ model context
```

## Worked example

1,000 documents of 5,000 tokens, split into 512-token chunks with 64 tokens of overlap, make 12,000 chunks (12 per document) and 5,704,000 tokens to embed. With top-5, an 800-token system prompt and a 60-token question, each query sends 3,420 input tokens. At 2,000 queries a day for 30 days, answering with DeepSeek V4.1 Flash costs $48.39 a month at pay-as-you-go prices. Retrieving 70 chunks instead would need 37,100 tokens a query with the answer, more than BroadNet Gemma 4 VL 26B's 32,768-token context, which fits at most top-61 at this chunk size.

## How to choose chunk size, overlap and top-k

-   **Chunk size**: match the length of a passage that answers a typical question. FAQ entries and tickets suit small chunks; contracts and manuals suit larger ones.
-   **Overlap**: enough to keep a sentence that crosses a boundary in one chunk. It adds embedding tokens, not query tokens.
-   **Top-k**: the main cost lever per query. A long-context model lets you retrieve more passages; measure whether answers improve.
-   **Arabic text**: Arabic needs more tokens per word than English, so the same number of words makes more chunks. Normalize before indexing with the [Arabic text normalizer](https://broadrouter.com/tools/arabic-text-normalizer/).

## Questions

### How many chunks will my documents make?

With fixed-size chunks, chunks per document = (document tokens − overlap) ÷ (chunk size − overlap), rounded up; a document shorter than one chunk is one chunk. Multiply by the number of documents. Splitters that cut at paragraphs or sentences make slightly more, smaller chunks.

### What chunk size and overlap should I use?

There is no universal best. Start near the length of a passage that answers a typical question, with a small overlap so sentences that cross a boundary survive. Smaller chunks match narrow questions better; larger ones keep context together. Test retrieval on 50 real questions from your users and keep the setting that finds the right passage most often.

### How many tokens does RAG add to each request?

Top-k × chunk size, plus the system prompt and the question. Five 512-token chunks add 2,560 input tokens to every query, so retrieval is usually most of the input bill. Lower top-k or chunk size to cut cost; raise them if answers miss information.

### Does BroadNet Inference offer embeddings?

No. BroadNet's API reference lists chat completions, audio transcriptions and a model list, but no embeddings endpoint. Use any embedding provider or a self-hosted embedding model for the index, enter its price per 1M tokens here, and use BroadNet's chat models to answer from the retrieved passages. [Compare embedding prices](https://broadrouter.com/tools/embedding-cost-calculator/).

### What if top-k × chunk size exceeds the context window?

The request fails or gets truncated. The calculator warns when the system prompt, question, retrieved chunks and reserved answer pass the chosen model's context window, and shows the largest top-k that fits.

### Is RAG cheaper than putting the whole document in the prompt?

For large or many documents, yes, because each query sends only the retrieved chunks. For a small set that fits in a long context window, sending it all can be simpler and, with prompt caching, affordable. [Long context vs RAG](https://broadrouter.com/blog/long-context-vs-rag/).

## Go deeper

-   [Long context vs RAG](https://broadrouter.com/blog/long-context-vs-rag/)
-   [Arabic RAG: normalisation, chunking and retrieval](https://broadrouter.com/blog/arabic-rag-search/)
-   [Embedding cost calculator](https://broadrouter.com/tools/embedding-cost-calculator/)
-   [Context window calculator](https://broadrouter.com/tools/context-window-calculator/)
-   [Arabic text normalizer](https://broadrouter.com/tools/arabic-text-normalizer/)

## More free tools

-   [**LLM API cost calculator**Price a workload on every model at once, with cache hits, reasoning and a flat-plan check.](https://broadrouter.com/tools/llm-api-cost-calculator/)
-   [**Speech-to-text cost calculator**Hours, calls or voice notes to a monthly transcription bill, against your current provider.](https://broadrouter.com/tools/speech-to-text-cost-calculator/)
-   [**LLM token counter**Exact token counts with each model's real tokenizer, with a token view and cost.](https://broadrouter.com/tools/token-counter/)
-   [**Arabic token counter**Arabic vs English token counts per tokenizer: the "Arabic tax" in tokens and money.](https://broadrouter.com/tools/arabic-token-counter/)
-   [**Tokens to words converter**Tokens ↔ words ↔ characters ↔ pages, by language and content type.](https://broadrouter.com/tools/tokens-to-words/)
-   [**Context window calculator**Will it fit? Window used per model, room left for output, cost to send.](https://broadrouter.com/tools/context-window-calculator/)
-   [**Flat-rate vs per-token LLM cost calculator**Break-even between an unlimited plan and paying per token, per agent.](https://broadrouter.com/tools/flat-rate-vs-per-token-calculator/)
-   [**Prompt caching savings calculator**Bill with and without caching, by prefix share and hit rate.](https://broadrouter.com/tools/prompt-caching-calculator/)
-   [**Image token calculator**Tokens and cost per image under each model's documented rule. Drop an image; nothing is uploaded.](https://broadrouter.com/tools/image-token-calculator/)
-   [**Self-hosting vs API cost calculator**GPU rental against your current API and BroadNet per-token and flat-plan prices: cost per 1M tokens and break-even volume.](https://broadrouter.com/tools/self-hosting-vs-api-calculator/)
-   [**Embedding cost calculator**Index, update and query costs for a corpus at OpenAI, Google, Voyage, Mistral and Jina list prices.](https://broadrouter.com/tools/embedding-cost-calculator/)
-   [**LLM rate limit and concurrency calculator**Which limit binds first: RPM, TPM or concurrency, with Little's law.](https://broadrouter.com/tools/llm-rate-limit-calculator/)
-   [**JSON schema generator for LLM structured output**Sample JSON to strict schema, Pydantic, Zod and a ready request.](https://broadrouter.com/tools/json-schema-generator/)
-   [**OpenAI-compatible API request builder**One request, copied as curl, Python, Node or the OpenAI SDKs.](https://broadrouter.com/tools/api-request-builder/)
-   [**Audio file splitter for speech-to-text limits**Chunk count, overlap and copy-ready ffmpeg commands to fit a transcription file-size limit.](https://broadrouter.com/tools/audio-splitter-ffmpeg/)
-   [**Agent run cost estimator**Context growth per step, total tokens and cost of one agent run, with a DeepSeek session comparison.](https://broadrouter.com/tools/agent-run-cost-estimator/)
-   [**OpenAI to BroadNet migration helper**Paste OpenAI SDK code; get base URL, key and model edits, a diff and the checks that remain.](https://broadrouter.com/tools/openai-to-broadnet-migration/)
-   [**Arabic text normalizer**Tashkeel, tatweel, alef, ya, ta marbuta, digits and invisible characters, with a matching Python function.](https://broadrouter.com/tools/arabic-text-normalizer/)
-   [**max\_tokens calculator for reasoning models**Answer length + reasoning budget + margin = a max\_tokens that does not cut the answer off.](https://broadrouter.com/tools/reasoning-token-budget/)
-   [**LLM batch job planner**Run time, binding limit, cost per model and the flat sessions needed to finish a big job by a deadline.](https://broadrouter.com/tools/llm-batch-job-planner/)
-   [**LLM JSON output validator**Parse errors by line and column, safe repairs, cut-off detection and JSON Schema checks for model output.](https://broadrouter.com/tools/llm-json-output-validator/)
-   [**Prompt token diff**Two prompt versions side by side: changed lines, exact token delta and the monthly cost difference.](https://broadrouter.com/tools/prompt-token-diff/)

Try it on your real workload. New accounts start with $5 of credit for Gemma and transcription. DeepSeek, GLM and Qwen3.8 need a top-up.

[Get started](https://inference.broadnet.ai/account/?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-rag-chunking-calculator&utm_content=page-cta) ·

**Sources**

-   [BroadNet Inference machine-readable prices (pricing.json)](https://inference.broadnet.ai/pricing.json?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-rag-chunking-calculator&utm_content=sources)
-   [BroadNet Inference API reference: documented endpoints (no embeddings; checked 2026-11-15)](https://inference.broadnet.ai/docs?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-rag-chunking-calculator&utm_content=sources)
-   [BroadNet Inference prices](https://inference.broadnet.ai/pricing?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-rag-chunking-calculator&utm_content=sources)
-   [Lewis et al., Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (arXiv 2005.11401)](https://arxiv.org/abs/2005.11401)
