Fixed-Size Chunking
What you'll learn: How to split documents into equal-sized pieces for predictable and simple RAG retrieval.
The Core Idea
Fixed-size chunking is the most straightforward approach to breaking documents into retrievable pieces: you simply divide text into chunks of a constant length. Think of it like cutting a long rope into segments of exactly 10 feet each—no measuring, no judgment calls, just mechanical division.
You can measure "size" in two ways:
- Character count: Split every N characters (e.g., 500 characters per chunk)
- Token count: Split every N tokens (e.g., 200 tokens per chunk)
Token-based chunking is generally preferred because LLMs reason in tokens, making it easier to predict context window usage and costs.
Why It's Simple and Predictable
Fixed-size chunking offers complete predictability. You know exactly:
- How many chunks you'll create from a document
- How much memory each chunk requires
- How many tokens you'll send to your LLM per retrieved chunk
This makes capacity planning trivial. If your vector database can store 1 million vectors and each document produces exactly 10 chunks, you can index 100,000 documents—the math is simple.
The Basic Approach
Most implementations include overlap between chunks to avoid cutting sentences or ideas in half. For example, with 500-character chunks and 50-character overlap, chunk 2 starts at character 450, not 500.
Limitations
Fixed-size chunking ignores document structure entirely. It might split:
- Mid-sentence
- In the middle of a code block
- Between a heading and its content
Key Takeaway: Fixed-size chunking trades semantic awareness for simplicity and predictability—ideal for quick prototypes or when document structure is uniform, but often needs refinement for production RAG systems.