LLM context planning

Split the text. See the overlap.

Plan fixed-token chunks before you build a retrieval pipeline. See the number of chunks, repeated tokens, and the final chunk length.

Browser-only calculationsTransparent formulasFree to use
View calculation ↓
01 / Chunk configuration

Keep the boundaries visible.

Fixed-size sliding windows with a full overlap between adjacent chunks.

Manual token counts · no tokenizer loaded

Enter counts from your tokenizer or usage report. Character estimates are not exact token counts.

tokens
Total tokens in the source before duplication.
tokens
Maximum token count per chunk; greater than zero.
tokens
Repeated tokens; must be smaller than chunk size.

02 / Chunk plan

A little repetition adds up.

Fixed-token chunk count

6chunks

10,000 source tokens become 11,000 processed chunk tokens.

Duplicated tokens1,000
Final chunk length1,000
Window stride1,800Chunk size − overlap
Additional token volume10.0%Compared with the unsplit source

Sliding windows

200 tokens overlap
09,200 tokens
C1
C2
C3
C4
C5

First 5 of 6 chunks. Hatched areas repeat from the preceding chunk. Positions use zero-based, end-exclusive token offsets.

Preview positions in the original source
ChunkStartEndLength
102,0002,000
21,8003,8002,000
33,6005,6002,000
45,4007,4002,000
57,2009,2002,000

This is chunk-text arithmetic. It does not execute retrieval, estimate embedding cost, or predict answer quality. Semantic boundaries and retrieval settings need their own evaluation.

The formula, in plain sight.

Empty source → 0 chunks. Source up to one chunk → 1 chunk. Otherwise: 1 + ceil((length − size) / (size − overlap)). Processed tokens: length + (chunks − 1) × overlap for nonempty input.

How to calculate token chunks and overlap

Fixed-token chunking splits a source into windows. Overlap repeats tokens between adjacent chunks, so the total processed token volume can exceed the original source length.

  1. Enter the source length in tokens and a positive chunk size.
  2. Choose an overlap smaller than the chunk size; zero means no overlap.
  3. Inspect the chunk count, duplicated tokens and zero-based boundary table.

Worked example

A 10,000-token source with 2,000-token chunks and 200-token overlap produces six chunks, 1,000 duplicated tokens and a final chunk of 1,000 tokens.

The formula models fixed-size windows with full overlap. It does not choose semantic boundaries, measure retrieval quality or estimate embedding prices. Read the formulas and sources.