Will my prompt fit in the context window?
Need to check whether a prompt fits in the context window? Tokens are the unit AI providers bill in, and getting the count wrong throws off every cost estimate. This page helps developers building prompts get an accurate count and the cost that follows from it.
Start here: Will It Fit? Context Checker
Results update automatically as you type.
- Document
- 50,000 tokens
- Prompt / instructions
- 1,000 tokens
- Reserved for output
- 2,000 tokens
- Total needed
- 53,000 tokens
- Context window
- 128,000 tokens
- Docs of this size per call
- 2
Then: Context Window Planner
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
Why this isn't trivial
The part people underestimate: the window has to hold system prompt, history, retrieved context, the user message and the reserved output, which teams often forget. In practice the biggest savings come from trimming history or retrieved context to leave room for output, so it is worth modelling before you commit.
How it's calculated
We estimate this by summing all input segments plus reserved output and comparing to the model's window. Every figure uses the current provider prices baked into the site (reviewed daily), and you can override any input to match your own assumptions.
Frequently asked questions
Does output count against the window?+
Yes — you must reserve space for the generated tokens too.
What if it doesn't fit?+
Trim history or context, or move to a larger-window model.
Are these prices up to date?+
Yes. The model prices behind this calculator are refreshed and reviewed daily, so your estimate reflects current provider rates rather than a stale snapshot.
Related
Estimates for planning. Pricing data last reviewed 28 July 2026.