Context Window Budget Planner
Split a prompt into named sections (system instructions, examples, documents, the user message), reserve tokens for the reply, and see whether the total fits the model's context window. Each section is counted at about 4 characters per token, a rule of thumb for English text. The planner shows the total input, the tokens left after the reserve and the share of them in use, and it marks the budget as healthy, tight or exceeded. Treat the counts as estimates: code, JSON and non-Latin text usually take more tokens than this.
How to Use This Tool
- Pick a model in Target model. Its context window is shown next to the name and under Context limit.
- Set Output reserve to the tokens you want kept free for the reply (2,000 by default). It must be a whole number smaller than the window.
- Name each section and paste its text into the content box. Add section adds another and Remove deletes one.
- Read Budget overview: Total input, Available (the window minus the reserve), the usage bar and Tokens by section.
- Act on the status. Budget exceeded says how many tokens over you are, so shorten a section, lower the reserve or pick a model with a larger window.
Why Use This Tool?
For OpenAI and Anthropic models the context window holds the prompt and the reply together, so the tokens the model needs for its answer are not available for input. That is why the planner subtracts the output reserve first and measures your sections against what is left. Gemini lists separate input and output limits, and the planner still subtracts the reserve from the input limit, which errs on the safe side. Under 70% of the available tokens the status is healthy, from 70% to 100% it is tight, and above that it is exceeded. The 70% line is this tool's own warning threshold, chosen to leave room for estimate error. It is not a vendor rule.
The counts are a heuristic, not a tokenizer. Four characters per token is a rule of thumb for English prose, and real counts differ by model. Source code, minified JSON, Chinese, Japanese or Korean text and emoji usually take more tokens per character, so the estimate runs low for them. When a prompt is close to the limit, count it with the vendor's own tokenizer or token counting API before you send it. The model list holds nine models whose limits were read from vendor documentation on the date shown under the results. Vendors change limits, so confirm the number there.