AI context planning
Context Window Calculator
Plan an LLM context budget for system instructions, conversation history, documents, answers, and reasoning. Estimate how many chunks a long document needs.
Context budget
This request exceeds the window. Shorten the content or split it into multiple requests.
- Window used
- 59,000 / 32,768
- New content per request
- 23,768
- Requests for new content
- 3
- Content tokens with overlap
- 52,000
- Total input tokens
- 53,000
- Reserved generation tokens
- 6,000
- Window overflow tokens
- 26,232
- Output overflow tokens
- 0
How the context and chunk budget works
System instructions, tool schemas, message formatting, and conversation history consume input tokens. A shared window also reserves space for answer and reasoning tokens. Each chunk repeats the fixed request overhead. When a document does not fit in one request, each later chunk advances by the content budget minus overlap.
For a 32,768-token shared window with 3,000 fixed input tokens and 6,000 reserved generation tokens, 23,768 new content tokens fit per request. A 50,000-token document with 1,000-token overlap needs 3 requests.
Use counts from the target tokenizer and include any API-specific formatting, tool, image, or document overhead. This calculator works from token totals and does not split the source text.