TokenPad
Counting

Context Window Calculator

Find out what fits, and what gets truncated.

Your context
Fits in
of 23 models
Characters0
Reserved for output1,000

Only models whose context window we have verified against the provider’s own documentation appear here. A number we cannot source is worse than no number.

Headroom by model

ModelCountTokensWindowUsedFit
GPT-5.6 SolOpenAIExact1.05M
GPT-5.6 TerraOpenAIExact1.05M
GPT-5.6 LunaOpenAIExact1.05M
Claude Fable 5AnthropicEstimate1M
Claude Opus 5AnthropicEstimate1M
Claude Opus 4.8AnthropicEstimate1M
Claude Opus 4.6AnthropicEstimate1M
Claude Sonnet 5AnthropicEstimate1M
Claude Sonnet 4.6AnthropicEstimate1M
Claude Sonnet 4.5AnthropicEstimate200K
Claude Haiku 4.5AnthropicEstimate200K
Gemini 2.5 FlashGoogleEstimate1M
DeepSeek V4 FlashDeepSeekEstimate1M
DeepSeek V4 ProDeepSeekEstimate1M
Grok 4.5xAIEstimate500K
Grok 4.3xAIEstimate1M
Grok Build 0.1xAIEstimate256K
Mistral Medium 3.5Mistral AIEstimate256K
Mistral Large 3Mistral AIEstimate256K
Mistral Small 4Mistral AIEstimate256K
Magistral MediumMistral AIEstimate256K
Devstral 2Mistral AIEstimate256K
Ministral 3 8BMistral AIEstimate256K

What this tool tells you

The context window is the total working memory of a request. Everything competes for the same budget: the system prompt, every prior turn, tool definitions, attached documents, and the response the model is about to generate. Paste your text here and each model shows how much of its window you would consume and whether the request would go through at all.

Only models whose window we have verified against the provider’s own documentation appear in the table. Where a provider does not publish the figure clearly, the model is left out rather than filled in with a plausible guess.

Why you must reserve room for the answer

This is the failure people hit first. Your 190,000 token document technically fits inside a 200,000 token window — and then the model has 10,000 tokens to think and answer in, which is not enough for a substantial reply. Set the reserve field to the longest answer you actually need. For a summary, a few hundred tokens. For a rewritten document or a generated file, size it to the output.

Overflow behaviour varies. If the input alone exceeds the window, every provider rejects the request outright. If input plus your requested maximum output exceeds it, newer models generally accept the call and simply stop generating when the limit arrives — which produces a truncated answer rather than an error, and is considerably harder to notice in production.

A bigger window is not automatically better

Million-token windows are now common, and the instinct is to fill them. Resist it. Retrieval and recall degrade as the window fills — the effect usually called context rot — and Anthropic’s own documentation makes the point explicitly: curating what goes into context matters as much as how much space is available.

In practice a tightly retrieved 20,000 token prompt beats a padded 500,000 token one on both accuracy and cost, and the cost difference is not marginal. Long context is billed on every turn of a conversation, so a bloated prompt is not a one-off charge — it is a per-request tax that compounds across the whole deployment. The cost calculator will show you what the padding is worth annually.

When your text does not fit

  • Retrieve instead of stuffing. Chunk the document, embed it, and send only the passages relevant to the question. This is almost always the right answer and almost always cheaper.
  • Compact the conversation. For long agent sessions, summarise earlier turns into a compact state artifact rather than replaying the full history on every call.
  • Strip structural waste first. Minified JSON, no pretty-printing, no repeated boilerplate. Frequently removes 20–30% with zero information loss — see it happen in the tokenizer playground.
  • Then, and only then, move to a larger window. It is the expensive option, and it treats the symptom.

On the counts in this table

Token counts for OpenAI models are exact — the real encoding runs in your browser. Counts for other providers are marked as estimates because no browser tokenizer exists for them. When you are close to a window limit, that distinction matters: leave real headroom rather than trusting an estimate to the last percent. The token counter shows the same figures alongside cost, and the methodology page documents every scaling factor.

Frequently asked questions

Does the context window include the model’s response?
Yes. The window is a single budget covering the system prompt, every message in the conversation, tool definitions, documents, and the tokens the model generates in reply. If your input alone fills the window there is no room left to answer, and the request fails.
Is a bigger context window always better?
No. Recall and accuracy degrade as the window fills — the effect usually called context rot. Anthropic’s own documentation makes this point: curating what goes into context matters as much as how much space is available. A well-trimmed 20K prompt often beats a padded 500K one.
What happens when I exceed the limit?
The API rejects the request with an error rather than silently trimming it. On some newer models, if the input fits but input plus the requested maximum output does not, the request is accepted and generation simply stops when the window is reached.

More counting tools