Context window calculator
Enter token counts for each part of your request and reserve room for generated output. Compare the total with a dated API model preset or your own limits.
Results
- Context budget check
- Fits the entered budget
- Total reserved tokens
- 110,000
- Context headroom
- 940,000
- Output-limit overage
- 0
| Component | Tokens | Share of context window |
|---|---|---|
| Instructions | 1,000 | 0.1% |
| Tool schemas | 2,000 | 0.19% |
| Documents and retrieved content | 80,000 | 7.62% |
| Conversation history | 10,000 | 0.95% |
| Current user message | 1,000 | 0.1% |
| Other request / formatting tokens | 0 | 0% |
| Visible output reserve | 8,000 | 0.76% |
| Reasoning / other generated reserve | 8,000 | 0.76% |
| Safety margin | 0 | 0% |
- Context window: 1,050,000; maximum generated output: 128,000. Presets checked 2026-11-14; review due 2027-02-12.
- Fit is conditional on your counts and reserves. No tokenizer or API request runs here. Use an exact whole-request count when possible; include formatting and tool schemas.
- This checks API token capacity, not model quality, rate limits, subscription limits or cost. Budget your configured output allowance when checking full request capacity.
How it works
Add input components without overlap, then reserve space for visible output, reasoning or other generated tokens, and an optional safety margin. OpenAI’s conversation-state guide defines the context window as input plus output and reasoning. The generated reserve must also respect the model’s separate output limit.
input = instructions + schemas + documents + history + message + formatting
generated reserve = combined reserve OR (visible output + reasoning / other generated reserve)
required = input + generated reserve + safety margin
fits = required ≤ context window AND generated reserve ≤ output limit
Choose separate reserves or the editable reasoning-model starting preset. OpenAI recommends at least 25,000 tokens for reasoning and outputs when starting experiments. The combined field starts at 25,000 and includes all generated tokens; the hidden split fields are ignored. This is an initial planning recommendation, not typical consumption or a guaranteed sufficient allowance. Adjust it using measured usage and your model’s output limit.
Presets checked November 14, 2026: GPT-6.1 Sol’s API window is 1,050,000 tokens with 128,000 maximum output; legacy GPT-4o has 128,000 and 16,384 respectively. These are API limits, not subscription allowances.
No tokenizer is bundled. The token-counting guide explains that full requests include formatting and schema tokens that plain-text tokenization can miss. If you have an exact request total, enter it in one input component and set the other input components to zero. Keep generated reserves separate. A safety margin is your planning choice, not a documented overhead constant.
Rounding: token arithmetic uses whole counts without intermediate rounding; displayed component percentages use up to two decimals. A fit result is conditional on the entered counts and allowances, not a guarantee that every endpoint will accept a request.
Worked examples
A 108,000-token budget in a legacy window
Use the GPT-4o preset and separate reserves: instructions 1,000, schemas 2,000, documents 80,000, history 10,000, current message 1,000, formatting 0, visible output 14,000, reasoning reserve 0 and margin 0. Input is 94,000; the total is 108,000, leaving 20,000 tokens. The 14,000 generated reserve is below the 16,384 output limit, so it fits.
Output can fail even with ample context space
With the GPT-4o preset and separate reserves, enter 1,000 instructions, zero other input components, 17,000 visible output, zero reasoning and zero margin. Total is only 18,000, leaving 110,000 context tokens, but output exceeds the separate limit by 616. The budget does not fit.
Frequently asked questions
Can I paste a document instead of counting tokens?
Do tool schemas consume context?
Is output reserve the same as maximum output?
Does an exact fit count as fitting?
Does a larger context window guarantee good answers?
Sources
- OpenAI counting tokens — request formatting and tool schemas (checked 2026-11-14)
- OpenAI conversation state — context and output limits (checked 2026-11-14)
- GPT-6.1 Sol — API context and maximum output (checked 2026-11-14)
- GPT-4o — legacy model context and maximum output (checked 2026-11-14)
- OpenAI reasoning — generated tokens occupy context (checked 2026-11-14)
Last reviewed 2026-11-14; next review due by 2027-02-12. The method is written out above so you can check our math.