AI model context window calculator
Check whether your text fits in the context window of Claude, GPT or Gemini and how much of it you use, answer included.
Calculator inputs
Results
Enter your values and press “Calculate” to see the result.
| Provider | Model | Window (tokens) | Window used (%) | Fits | Free tokens |
|---|---|---|---|---|---|
| OpenAI | GPT-6 Astra | 1,050,000 | 14.7 | Yes | 896,000 |
| OpenAI | GPT-6.1 Sol | 1,050,000 | 14.7 | Yes | 896,000 |
| OpenAI | GPT-6 Luna | 1,050,000 | 14.7 | Yes | 896,000 |
| OpenAI | GPT-5.5 | 1,050,000 | 14.7 | Yes | 896,000 |
| OpenAI | GPT-5.4 | 1,050,000 | 14.7 | Yes | 896,000 |
| Gemini 3.8 Flash | 1,048,576 | 14.7 | Yes | 894,576 | |
| Gemini 3.5 Flash | 1,048,576 | 14.7 | Yes | 894,576 | |
| Gemini 3.5 Flash-Lite | 1,048,576 | 14.7 | Yes | 894,576 | |
| Gemini 3.1 Flash-Lite | 1,048,576 | 14.7 | Yes | 894,576 | |
| Gemini 3.1 Pro | 1,048,576 | 14.7 | Yes | 894,576 | |
| Gemini 2.5 Pro | 1,048,576 | 14.7 | Yes | 894,576 | |
| Gemini 2.5 Flash | 1,048,576 | 14.7 | Yes | 894,576 | |
| Gemini 2.5 Flash-Lite | 1,048,576 | 14.7 | Yes | 894,576 | |
| OpenAI | GPT-4.1 | 1,047,576 | 14.7 | Yes | 893,576 |
| Anthropic | Claude Fable 5.1 | 1,000,000 | 15.4 | Yes | 846,000 |
| Anthropic | Claude Opus 5.5 | 1,000,000 | 15.4 | Yes | 846,000 |
| Anthropic | Claude Opus 5 | 1,000,000 | 15.4 | Yes | 846,000 |
| Anthropic | Claude Sonnet 5.5 | 1,000,000 | 15.4 | Yes | 846,000 |
| Anthropic | Claude Sonnet 4.6 | 1,000,000 | 15.4 | Yes | 846,000 |
| Anthropic | Claude Haiku 5.5 | 1,000,000 | 15.4 | Yes | 846,000 |
| OpenAI | GPT-5.4 mini | 400,000 | 38.5 | Yes | 246,000 |
| OpenAI | GPT-5.4 nano | 400,000 | 38.5 | Yes | 246,000 |
| OpenAI | GPT-5 mini | 400,000 | 38.5 | Yes | 246,000 |
| OpenAI | GPT-5 nano | 400,000 | 38.5 | Yes | 246,000 |
| Anthropic | Claude Haiku 4.5 | 200,000 | 77 | Yes | 46,000 |
| OpenAI | o3 | 200,000 | 77 | Yes | 46,000 |
| OpenAI | GPT-4o mini | 128,000 | 120.3 | No | -26,000 |
See the working step by step
- Claude Sonnet 5.5 (Anthropic) window: 1,000,000 tokens
Data updated 2026-10-07 · Indicative result: it does not replace professional advice
In short
- What it calculates
- Check whether your text fits in the context window of Claude, GPT or Gemini and how much of it you use, answer included.
- Formula used
Total tokens = input (in tokens) + expected answer (with reasoning)- Example
- Example 1. A long report in a 1-million model.
AI context window calculator
Every language model has a context window: the maximum number of tokens it can handle at once. Everything goes in it: your instructions, the documents you attach, the conversation history, tools and also the model’s answer (with its reasoning, if it does any). Go over and the request fails or the model cuts off.
Enter how much you send (in tokens, words, characters or pages) and how much answer you expect, pick a model and you see how much of its window you use, how much is left and in how many models on the list it fits. The data carries a review date. Everything runs in your browser.
How it works
What you send is converted to tokens (if you do not give tokens, using the approximate English equivalence: 1 token ≈ 0.75 words ≈ 4 characters), the expected answer is added and the total is divided by the model’s window. If the total is below the window, it fits; the difference is the free tokens, which are turned into approximate words and pages.
Each model’s data (window and maximum output) lives in a file with its review date and official sources.
Formula
Total tokens = input (in tokens) + expected answer (with reasoning)
Window used = total tokens ÷ model window
It fits if total tokens ≤ window
Approximate equivalences (English): 1 token ≈ 0.75 words ≈ 4 characters; 1 page ≈ 500 words
Worked example
Example 1. A long report in a 1-million model.
150,000 tokens of documents and 4,000 of answer in Claude Sonnet 5.5 (1,000,000 window): 154,000 tokens, 15.4% of the window, with 846,000 tokens free. It fits in 26 of the 27 models on the list (only GPT-4o mini, at 128,000, is left out).
Example 2. A 200,000 model.
A 250,000-token prompt in Claude Haiku 4.5 (200,000) takes 127% (over by 54,000 tokens counting the 4,000 of answer): it does not fit. You would need to trim it or use a model with a larger window.
Example 3. In words.
A 300,000-word manuscript is about 400,000 tokens; with 4,000 of answer it totals 404,000: in GPT-5.4 mini (400,000) it is over by 4,000 tokens.
Example 4. A 400-page book.
400 pages of 500 words is 200,000 words, about 266,667 tokens. With 8,000 of answer, 274,667: in GPT-4o mini (128,000) it takes 214.6%; it fits in 24 of the 27 models.
Explanation
What the context window is
It is the model’s “working memory”: the total tokens it can consider when generating an answer. It includes everything in the request (system instructions, messages, documents, tool results, images) and also what the model generates, reasoning included. It is not the same as the data it was trained on.
Context window versus maximum output
They are two different limits: the window limits the sum of input and output; the maximum output limits how much the model can write in a single answer. A model with a 1-million window may have, say, a 128,000-token maximum output.
More context is not always better
As the token count grows, the model’s accuracy and recall degrade: Anthropic calls this “context rot”. Send what is needed and do not fill the window for its own sake; techniques such as summarising, trimming old results or retrieving only the relevant fragments help.
How to estimate tokens
The most reliable way is the provider’s token counter. As a rough guide, in English a token is about 0.75 words (about 4 characters); in other languages there are more tokens per word. Each provider tokenizes differently: the same text gives different figures depending on the model, and Claude 4.7 and later produce about 30% more tokens than earlier ones for the same text.
Common mistakes
- Forgetting that the answer and reasoning also take up the window.
- Trusting the words-to-tokens conversion in languages other than English.
- Filling the window to the brim: leave a margin.
- Comparing windows without comparing maximum output.
- Treating limits as fixed: they change with each model.
Limits of this calculator
- The data are those of the standard API at the review date; they do not include extended contexts in beta or by contract, nor the limits of chat apps or usage tiers.
- There is no maximum-output figure for Claude Haiku 4.5 in the source consulted.
- The OpenAI and Google figures were taken from their pages with a tool that summarises the content: check them on the official page.
- The conversion of words, characters and pages to tokens is approximate and based on English.
- It does not count images, audio or tools, which also use tokens.
Notice
This is an estimate. Count tokens with the provider’s tool before fitting a case right to the limit.
Frequently asked questions
What is the context window?
The maximum number of tokens a model can handle at once, adding what you send (instructions, documents, history) and what it answers, reasoning included.
What happens if I exceed the window?
The API usually returns a “prompt too long” error, or the model cuts off its answer when it hits the limit. You need to trim the content or use a model with a larger window.
How many words fit in a million tokens?
About 750,000 English words using 0.75 words per token. With Claude’s newest tokenizers, Anthropic gives about 555,000 words.
Is the context window the same as maximum output?
No. The window limits the sum of input and output; maximum output limits what the model can write in a single answer.
Should I fill the whole window?
Not necessarily: with very long contexts the model recalls and answers less well. Send only what is needed.
How do I count the tokens in my text?
With the provider’s token counter, which gives the exact figure for its model. The word conversion is only a guide.
Why does my text in another language use more tokens than I expected?
Because in languages other than English there are usually more tokens per word (accents, long words, morphology). Leave a margin.
Is my data sent to a server?
No. The calculation runs in your browser.
Sources and references
The formula behind this calculator is not ours. These are the sources it comes from, in APA 7 format, in case you want to go to the original or cite them in your own work.
- Anthropic. (2026). Context windows. Claude Developer Platform. Consultado el 7 de octubre de 2026, de https://platform.claude.com/docs/en/build-with-claude/context-windows https://platform.claude.com/docs/en/build-with-claude/context-windows What counts toward the window (input, answer and reasoning), sizes by model and the degradation of recall in long contexts.
- OpenAI. (2026). Models. Consultado el 7 de octubre de 2026, de https://developers.openai.com/api/docs/models https://developers.openai.com/api/docs/models Context window and maximum output of each OpenAI model.
- Google. (2026). Gemini models. Gemini API. Consultado el 7 de octubre de 2026, de https://ai.google.dev/gemini-api/docs/models https://ai.google.dev/gemini-api/docs/models Input and output token limits of each Gemini model.
Need to calculate something else?
These tools are often used alongside this calculator.
Token cost
What each request to a language model costs and the monthly bill, with prompt caching, reasoning tokens and…
AI cost comparison
What your API usage costs with each Anthropic, OpenAI and Google model, with caching and discounts, ranked…
API cost
Monthly and annual spend on an API with a fixed fee and volume pricing, to compare up to three plans and see…
Word count
Words, characters, sentences and paragraphs in any text.