Fixed-size chunking

On this page 6

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.

ParameterTypical rangeWhat it affects
Chunk size128 to 1,024 tokensPrecision of matches and amount of context per hit
Overlap10 to 20 percent of chunk sizeProtection against facts cut at boundaries
Unit of measureTokens, characters or wordsAccuracy against the model input limit
StrideChunk size minus overlapNumber of chunks and index size
Parameters of a fixed-size chunker

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 caseSuggested chunk sizeReason
FAQ and short answers128 to 256 tokensOne question and answer per chunk
Technical documentation256 to 512 tokensKeeps a procedure or definition together
Legal and policy texts512 to 1,024 tokensClauses depend on surrounding conditions
Chat logs and transcripts200 to 400 tokensCaptures a few turns of conversation
Starting points for chunk size by use case

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.

StrategyBoundary ruleCostMain trade-off
Fixed-size chunkingFixed token or character countVery lowIgnores sentence and topic boundaries
Recursive chunkingSeparator hierarchy with size limitLowDepends on clean formatting
Semantic chunkingShifts in embedding similarityMediumUneven sizes and extra embedding calls
Late chunkingSplit after full-document encodingMedium to highNeeds long-context embedding models
Chunking strategies compared

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.

SymptomLikely causeFix
Answers cut off mid-sentenceNo or tiny overlapAdd 10 to 20 percent overlap
Irrelevant chunks rank highlyChunks too largeReduce chunk size and re-evaluate
Truncated embeddingsSize measured in charactersCount tokens with the model tokenizer
Broken tables and codeCuts ignore structurePre-split structured blocks separately
Duplicate results in top kExcessive overlapLower overlap or deduplicate results
Common problems with fixed-size chunking

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.