Context Window Planner
Check whether your prompt, history and context fit a model's window.
Results update automatically as you type.
- System prompt
- 400 tokens
- Conversation history
- 2,000 tokens
- Retrieved / context
- 3,000 tokens
- User message
- 200 tokens
- Total input
- 5,600 tokens
- Context window
- 128,000 tokens
- Remaining
- 122,400 tokens
Plan your prompt against a model's context window. Add up your system prompt, conversation history, retrieved context, user message, and desired output, and instantly see whether it all fits and how much room is left.
How this is calculated
This calculator uses the prompt engineering formulas described in our methodology. All figures are estimates for planning; verify current pricing with each provider before relying on them.
Worked example (defaults)
With the default inputs above, here is the result:
- System prompt
- 400 tokens
- Conversation history
- 2,000 tokens
- Retrieved / context
- 3,000 tokens
- User message
- 200 tokens
- Total input
- 5,600 tokens
- Context window
- 128,000 tokens
- Remaining
- 122,400 tokens
Frequently asked questions
What is a context window?+
It is the maximum number of tokens a model can consider at once, including everything you send plus (usually) the tokens it generates.
What happens if I exceed the context window?+
The API rejects the request or truncates content. Fit more by trimming history, retrieving fewer chunks, or choosing a model with a larger window.