In our latest guide on embeddings and vector databases, we saw how embeddings turn text into vectors and how a vector database stores and searches them. Here we look at the step that comes before that: how to split documents into chunks.
Retrieval-Augmented Generation (RAG) helps Large Language Models (LLMs) answer questions using external data, such as company documents, product manuals or research papers. But a good RAG application isn't just an LLM wired to a vector database. How you prepare the data before storing it decides how accurately the system retrieves information.
That's where chunking comes in.
Picture a 200-page document uploaded to an AI chatbot. When someone asks a question, the chatbot doesn't reread all 200 pages. It searches for the relevant sections and answers from those. Chunking makes this possible by breaking large documents into smaller pieces that can be stored, searched and retrieved.
Split the document the wrong way, though, and quality drops. A chunk that misses context leaves the model guessing. A chunk that's too large buries the exact answer in noise. In this article, we'll walk through nine chunking strategies for RAG, how each works, where each falls short, and which one to start with.
Key Takeaways
- Chunking strategy alone can change retrieval recall by up to 9% on the same data (
- Recursive chunking at around 200 tokens with no overlap is a strong, cheap baseline.
- Semantic chunking's extra cost isn't backed by consistent gains (
What Is Chunking in RAG?
Chunking is the process of dividing a large document or dataset into smaller, manageable sections called chunks. Each chunk must fit the embedding model's input limit, which is 8,191 tokens for OpenAI's text-embedding-3 models, though most RAG pipelines use chunks far smaller than that ceiling.
These chunks are converted into embeddings and stored in a vector database. When a user asks a question, the system searches for the most relevant chunks and passes them to the LLM as context for its answer.
How Does Chunking Fit Into the RAG Pipeline?
Chunking sits third in a typical eight-stage RAG pipeline, and every later stage depends on it. NVIDIA's 2025 benchmark found end-to-end answer accuracy varied from 0.603 to 0.648 across chunking methods on identical documents and models (NVIDIA Developer Blog, 2025).
A typical RAG pipeline follows this process:
- Document ingestion: Load PDFs, Word files, web pages or other data sources.
- Document processing: Extract text and keep useful structural information.
- Chunking: Divide the extracted content into meaningful sections.
- Embedding generation: Convert each chunk into a numerical representation of its meaning (the vector's dimensions depend on the embedding model you choose).
- Vector storage: Store embeddings alongside their content and metadata.
- Retrieval: Find chunks relevant to the user's question.
- Context construction: Prepare the retrieved information for the LLM.
- Response generation: Generate an answer grounded in the retrieved context.
If important information gets separated from its surrounding context, even a capable embedding model may struggle to find it. The goal isn't simply smaller chunks. It's chunks that keep useful meaning and improve retrieval.
Why Is Chunking Important in RAG?
Chunking affects retrieval accuracy, context quality, token cost and speed all at once. Anthropic showed that simply prepending context to each chunk before embedding cut failed retrievals by 35%, and by 49% when combined with BM25 keyword search (Anthropic, 2024).
1. Retrieval Accuracy
The retrieval system has to find the information that best matches a user's question. Meaningful chunks help it return relevant content instead of unrelated sections from the same document.
2. Context Preservation
Information often depends on the sentences around it. A good chunking strategy keeps enough context that each retrieved section makes sense on its own.
3. Response Quality
An LLM can only use what's in its context. If retrieval returns incomplete or irrelevant chunks, the answer will be incomplete or wrong too.
4. Token Usage and Cost
Sending unnecessary text to an LLM raises token usage and cost. Well-sized chunks keep the context window lean.
5. Processing Speed
Chunk size and count affect embedding time, vector search and context preparation. The right balance depends on your application and infrastructure.
A useful way to picture the relationship:
Chunking → Embeddings → Retrieval → Context → LLM Response
Good chunking can't guarantee a correct answer. Poor chunking, however, can break things before the LLM ever sees the data.
9 Chunking Strategies for RAG at a Glance
No single method wins on every document. Chroma's 2024 evaluation found the popular 800-token, 400-overlap default performed below simpler settings on recall-efficiency trade-offs (Chroma Research, 2024). Use this table to shortlist, then read the detail below.
| Strategy | Splits by | Cost | Best for |
| Fixed-size | Token or character count | Very low | Prototypes, baselines |
| Sentence-based | Sentence boundaries | Low | FAQs, articles, prose |
| Semantic | Meaning shifts (embedding similarity) | Medium to high | Multi-topic reports |
| Recursive | Paragraph → line → word hierarchy | Low | General-purpose RAG |
| Sliding window | Fixed size with overlap | Low to medium | Text with cross-boundary dependencies |
| Hierarchical | Document → section → paragraph | Medium | Handbooks, legal, technical docs |
| Topic-based | Subject labels or classifiers | Medium | Multi-domain knowledge bases |
| Modality-specific | Content type (text, table, image, audio) | High | PDFs with tables, video, scans |
| Agentic | An AI agent's per-document decision | High | Varied, heterogeneous datasets |
1. What Is Fixed-Size Chunking?
Fixed-size chunking divides text into equal sections measured in tokens or characters. NVIDIA tested sizes from 128 to 2,048 tokens and found 128-token chunks scored worst on one dataset (0.421 accuracy) while page-sized chunks scored best (0.520), so size matters even within this simple method (NVIDIA, 2025).
Make sure the chunk size fits within your embedding model's maximum input length, or the extra text may be cut off. Once the limit is reached, the system starts a new chunk.
Advantages
- Easy to implement.
- Needs very little processing.
- Useful for simple documents and early RAG prototypes.
- Gives predictable chunk sizes.
Limitations
- May split a sentence or paragraph in the middle.
- Can separate key information from its explanation.
- Doesn't understand the meaning of the text.
When should you use it?
Fixed-size chunking is a reasonable starting point for straightforward text, especially when you want a baseline before testing more advanced methods.



