#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
🧩 FREE · LIVE CHUNK PREVIEW

RAG Chunk Size Calculator: Plan Your Chunking

See how chunk size, overlap and top-k change your vector count, embedding cost and prompt length.

  • 📄 Chunks per document
  • 🔁 Overlap cost
  • 📏 Context fit

How to use the RAG Chunk Size Calculator

  1. 1. Describe your documentsEnter how many documents you have and their average length in tokens, words or pages.
  2. 2. Set chunkingChoose chunk size, overlap, top-k, your model's context window and tokens reserved for the prompt and answer.
  3. 3. Check and previewSee totals, and paste sample text to preview the actual chunks.

How chunks are counted

Retrieval-augmented generation (RAG) splits documents into chunks, embeds each chunk as a vector and retrieves the most relevant ones for each question. With chunk size C and overlap O, each new chunk starts C − O tokens after the last. A document of T tokens therefore needs ceil((T − O) ÷ (C − O)) chunks, or 1 if it fits in a single chunk. The calculator checks this formula against a direct simulation in our tests.

Retrieval then adds top-k × C tokens to every prompt, on top of your system prompt, question and answer.

Worked example

The defaults are 200 documents of 10,000 tokens, 500-token chunks, 50-token overlap, top-5 and a 128,000-token context window with 3,000 tokens reserved. Each document gives 23 chunks (step 450 tokens), so you store 4,600 vectors. You embed 22,20,000 tokens, which is 11% more than the raw text because of the overlap. Each question retrieves 2,500 tokens, so the full prompt is 5,500 tokens, 4.3% of the context window.

Choosing a chunk size

  • Smaller chunks (200–400 tokens) match precise facts better; larger ones (800–1,200) keep more context together.
  • 10–15% overlap helps when answers span chunk boundaries; more mostly adds cost.
  • Split on headings and paragraphs where you can; the preview here uses word boundaries and about 4 characters per token.
  • Test on 20–30 real questions and compare answers; that beats any rule of thumb.

Frequently asked questions

Is my pasted text uploaded?

No. The preview runs entirely in your browser, and the text isn't sent anywhere.

How accurate are the word and page conversions?

They're estimates (about 1.33 tokens per English word and 500 words per page). Other languages and code can use more tokens per word.

Is the RAG chunk size calculator free?

Yes. You can open the RAG chunk size calculator and fill in everything without signing up. When you calculate chunks for the first time, we ask once for your name and WhatsApp number; after that it, and every other Uncodemy tool, opens straight away.

More free tools

See all free tools