Skip to content
Koit Academy

Chunk size calculator

Your numbers

The numbers filled in are an example. Replace them with yours.

Chunks

223 chunks

100,000 tokens in chunks of 500 with 50 overlapping means 111,100 tokens to embed, 11.1% more than the text itself, at a cost of about 0.0111. Each question adds about 2,500 tokens of retrieved text to the prompt.

How it adds up

ItemChunksTokens to embedRetrieved per question
200 tokens667133,3001,000
300 tokens400119,9501,500
500 tokens223111,1002,500
800 tokens134106,6504,000
1,000 tokens106105,2505,000
2,000 tokens52102,55010,000

Smaller chunks find more precise passages but carry less context each; larger ones keep more context but dilute the match and fill the prompt faster. There is no universal best size: test a few on real questions and compare the answers. Embedding prices change often, so use your provider’s current price.

Worked out from the numbers you enter. Calculated in this browser; nothing you enter is sent anywhere or stored.

How to use it · free, no signup

How to use the Chunk Size Calculator

Enter the size of your text, the chunk size and overlap, the chunks retrieved per question and the embedding price to see the chunks, tokens, cost and prompt size. Calculated in your browser.

  1. 01

    Enter the text size

    The total tokens in the documents you will search.

  2. 02

    Set chunk and overlap

    The size of each chunk and how much neighbouring chunks share.

  3. 03

    Add retrieval and price

    Chunks retrieved per question, and the embedding price.

How chunks are counted

Retrieval systems split documents into chunks, store each one with an embedding, and at question time return the chunks closest to the question. With a chunk size of S tokens and an overlap of O, each new chunk starts S − O tokens after the one before. A document of T tokens therefore makes one chunk plus one for every S − O tokens after the first.

FigureExample
Text to split100,000 tokens
Chunk size and overlap500 and 50 tokens
Chunks223
Tokens to embed111,100
Extra from overlap11.1%
Retrieved per question, 5 chunks2,500 tokens

What overlap costs

Overlap repeats the end of each chunk at the start of the next, so an idea that falls across a boundary is whole in at least one of them. Every boundary embeds the overlap twice. At 50 tokens on chunks of 500 that adds 11.1% to the tokens embedded; at 200 on chunks of 1,000 it adds about a quarter. Embedding is usually cheap, but storage and search scale with the number of chunks.

Choosing a chunk size

  • Smaller chunks match a question more precisely, but each carries less surrounding context.
  • Larger chunks carry more context, but the part that answers the question is diluted, and each fills more of the prompt.
  • Natural boundaries such as paragraphs and headings often matter more than the exact number.
  • Testing beats rules. Try two or three sizes on a set of real questions and compare the answers.

Retrieved text and the prompt

Every question pulls the top few chunks into the prompt, so chunk size times the number retrieved is added to each request: 2,500 tokens in the example. That has to fit in the model’s window alongside the instructions and the answer, which the context window calculator checks, and it is paid for on every request, which the AI API cost calculator prices.

Published by Koit Academy. Who runs it, how it is paid and how its tools are checked.

Questions

What people ask about the Chunk Size Calculator

What is chunking?
Splitting documents into smaller passages so that a search can find and return the parts relevant to a question, instead of the whole document. It is the first step of retrieval-augmented generation.
How many chunks will my document make?
With a chunk size S and an overlap O, a document of T tokens makes one chunk plus one more for every S − O tokens after the first chunk. 100,000 tokens in chunks of 500 overlapping by 50 makes 223.
Why overlap chunks?
So that a sentence or idea that falls on a boundary appears whole in at least one chunk. The cost is that the overlapping text is embedded twice.
What chunk size should I use?
There is no universal answer. Smaller chunks match more precisely but carry less context; larger ones carry more but dilute the match. Test a few sizes on real questions.
Does chunk size affect the prompt?
Yes. Each question retrieves several chunks into the prompt, so five chunks of 500 tokens add about 2,500 tokens to every request.