Fixed-size chunking is a document segmentation strategy that splits text into pieces of a predetermined length, measured in tokens, characters or words, usually with a fixed overlap between neighboring pieces. In retrieval & knowledge systems for artificial intelligence, it is the simplest and most widely used way to prepare documents for embedding and vector search in retrieval-augmented generation (RAG).
The method ignores the semantic structure of the text: a boundary falls wherever the counter reaches the limit, even in the middle of a sentence. This makes it fast, predictable and easy to tune, but it also means that related ideas can be separated and unrelated ideas combined, which is why overlap and careful size selection matter.
How fixed-size chunking splits a document
Fixed-size chunking works as a sliding window over the text. The pipeline first extracts plain text, then counts units from the start of the document and cuts a chunk every time the chunk size is reached. The next chunk starts a defined overlap before the previous cut, so the window advances by the stride, which equals the chunk size minus the overlap.
Most production pipelines measure size in tokens of the embedding model’s tokenizer, because embedding models have a hard input limit and tokens are what that limit counts. Character-based splitting is cheaper to compute but less precise, since the same number of characters can produce very different token counts across languages and formats.
The following table defines the parameters that control a fixed-size chunker.
| Parameter | Typical range | What it affects |
|---|---|---|
| Chunk size | 128 to 1,024 tokens | Precision of matches and amount of context per hit |
| Overlap | 10 to 20 percent of chunk size | Protection against facts cut at boundaries |
| Unit of measure | Tokens, characters or words | Accuracy against the model input limit |
| Stride | Chunk size minus overlap | Number of chunks and index size |
The number of chunks grows as the overlap grows. A 100,000-token document split into 500-token chunks with no overlap produces 200 chunks; with a 100-token overlap the stride falls to 400 tokens and the count rises to about 250 chunks, increasing embedding cost and storage by roughly a quarter.
Choosing chunk size and overlap
The right chunk size depends on what users ask and how the content is written. Small chunks produce embeddings that represent one focused idea, which helps precise factual lookups, but each retrieved chunk carries little surrounding context. Large chunks preserve context for the language model but blend several topics into one vector, which dilutes similarity scores and lowers retrieval precision.
There is no universally optimal value, and published experiments disagree because results depend on the corpus, the embedding model and the evaluation set. The table below gives reasonable starting points, which should then be validated with retrieval metrics such as Recall@k on a set of representative questions.
| Use case | Suggested chunk size | Reason |
|---|---|---|
| FAQ and short answers | 128 to 256 tokens | One question and answer per chunk |
| Technical documentation | 256 to 512 tokens | Keeps a procedure or definition together |
| Legal and policy texts | 512 to 1,024 tokens | Clauses depend on surrounding conditions |
| Chat logs and transcripts | 200 to 400 tokens | Captures a few turns of conversation |
Overlap is a safety margin, not a cure. An overlap of 10 to 20 percent usually catches sentences split at a boundary, while values above about 30 percent mostly add duplicate results and cost without improving recall.
Fixed-size chunking compared with other strategies
Fixed-size chunking is the baseline against which other chunking methods are measured. Recursive chunking tries a hierarchy of separators such as paragraphs, lines and sentences before falling back to a hard cut. Semantic chunking places boundaries where the meaning shifts, detected through embedding similarity between adjacent sentences. Late chunking embeds the whole document first and splits the token embeddings afterward, so each chunk vector carries document-level context.
| Strategy | Boundary rule | Cost | Main trade-off |
|---|---|---|---|
| Fixed-size chunking | Fixed token or character count | Very low | Ignores sentence and topic boundaries |
| Recursive chunking | Separator hierarchy with size limit | Low | Depends on clean formatting |
| Semantic chunking | Shifts in embedding similarity | Medium | Uneven sizes and extra embedding calls |
| Late chunking | Split after full-document encoding | Medium to high | Needs long-context embedding models |
In many evaluations, a well-tuned fixed-size chunker performs close to more sophisticated methods, especially on homogeneous prose. The gap widens on documents with strong structure, such as tables, code and nested headings, where structure-aware splitting keeps logical units intact.
Limitations and common mistakes
The central weakness of fixed-size chunking is context fragmentation. A definition may land in one chunk and its exception in the next, so the retriever returns half of the answer. Pronouns and references such as “this method” lose their antecedent, which makes the chunk embedding less meaningful.
The table below lists frequent problems, their causes and practical fixes.
| Symptom | Likely cause | Fix |
|---|---|---|
| Answers cut off mid-sentence | No or tiny overlap | Add 10 to 20 percent overlap |
| Irrelevant chunks rank highly | Chunks too large | Reduce chunk size and re-evaluate |
| Truncated embeddings | Size measured in characters | Count tokens with the model tokenizer |
| Broken tables and code | Cuts ignore structure | Pre-split structured blocks separately |
| Duplicate results in top k | Excessive overlap | Lower overlap or deduplicate results |
A practical mitigation is to attach metadata such as document title, section heading and page number to every chunk, or to prepend a short context summary. Techniques such as parent document retrieval and sentence window retrieval also compensate by returning a larger surrounding passage once a small chunk has matched.
In plain words
Imagine cutting a long book into cards of exactly the same length, say 300 words each. You do not care where a sentence ends. You simply count and cut.
An AI search system does this so it can find the right card quickly when someone asks a question. To avoid losing a sentence at the cut, each new card repeats the last few lines of the previous one. Fixed-size chunking is the simple, even-cut way to prepare text for AI search. It is quick and reliable, but sometimes an idea ends up split across two cards.
A real-world example
An IT support team at a mid-sized manufacturer builds an internal assistant that answers employee questions from about 2,000 pages of help-desk articles. The engineer starts with fixed-size chunking at 512 tokens with a 64-token overlap, embeds the chunks and tests the system on 150 real questions collected from past support tickets.
Recall@5 reaches about 78 percent, but several failures involve step-by-step procedures split between two chunks. Reducing the size to 300 tokens with a 60-token overlap and adding the article title to each chunk raises Recall@5 to roughly 88 percent. The team keeps this configuration because it is cheap to maintain and re-indexes the full collection in minutes whenever articles change.