Context Window Explained: Tokens, Limits and Cost
Quick answer
A context window is a model's working memory for one request. See what counts, how to convert tokens to words, current 1M sizes and why more text can lower accuracy.
A context window is the total amount of text a language model can work with in one request, measured in tokens. It covers your prompt, the earlier chat, any documents or tool results, and the reply the model writes. Anthropic describes it as the model's "working memory", separate from what the model learned in training.
Key takeaways
- The context window is working memory for one request: input, history, tool results and the model's own output all count.
- As of late November 2026, Anthropic lists many Claude models with a 1M-token window and Google lists Gemini 4 models at 1M tokens.
- A bigger window does not guarantee better answers. Anthropic says accuracy and recall degrade as token count grows, which it calls context rot.
- A rough rule: 100 tokens is about 60 to 80 English words, so you can budget a prompt before you send it.
On this page:
- What a context window is
- What counts toward the window
- Converting tokens to words
- Window sizes as of late November 2026
- A token budget for a student project
- Is a bigger window always better?
- Why does a chatbot forget?
- A checklist for everyday use
- Frequently asked questions
| Part of a request | Counts toward the window? | Example |
|---|---|---|
| System prompt | Yes | "You are a Python tutor. Keep answers short." |
| Earlier messages in the chat | Yes | Everything said in this conversation so far |
| Documents, images, tool results | Yes | A pasted PDF, a search result returned to the model |
| Tool definitions | Yes | The list of functions the model may call |
| The reply, including thinking | Yes | The answer plus any extended reasoning |
| Cached prompt prefix | Yes | Caching changes the cost, not the count |
What is a context window in simple words?
It is the model's desk. Whatever fits on the desk, the model can use. Whatever does not fit, it cannot see.
The Anthropic documentation defines the context window as all the text a language model can reference when generating a response, including the response itself. It calls this "working memory" and says it is distinct from the large body of data the model was trained on. So a model can know a lot about Python from training and still know nothing about your project until you put your code into the window.
If you are new to how these models are built, our guide to what an LLM is, with Indian examples covers the basics first.
What counts toward the window?
Everything in the request counts, and so does the answer. People often count only their own message and then wonder why a long chat hits the limit.
According to the Anthropic documentation, the window includes the system prompt, every message in the conversation (including tool results, images and documents) and your tool definitions. The output counts too, including any extended thinking. Anthropic also notes that cached prompt prefixes still occupy the window: prompt caching changes what you pay for those tokens, not whether they count.
There is a hard edge as well. Per the same page, if the input alone already exceeds the model's context window, the API returns a 400 invalid_request_error ("prompt is too long") on every model. In a chat app you usually see a friendlier message, but the limit is the same idea. If you want the next layer up, system prompts explained shows what sits at the top of every request.
How many words is a token?
A token is a chunk of text, not a word. For English, about four characters make one token.
Google's Gemini API documentation says a token is equivalent to about 4 characters, and 100 tokens is equal to about 60 to 80 English words. That gives a quick mental conversion:
- 1,000 tokens is roughly 600 to 800 words.
- A 5,000-word essay is roughly 6,000 to 8,000 tokens (5,000 divided by 0.8, and by 0.6).
- A 1M window is therefore very roughly 600,000 to 800,000 English words, shared with the reply.
Treat these as estimates for English prose. Code, tables and text in Hindi or other Indian languages can split into tokens differently, so check the token counter in the tool you use instead of trusting the rule. The Google token documentation is the place to read how Gemini counts them.
How big are context windows as of late November 2026?
As of late November 2026, 1M tokens is common on the flagship models of the two vendors whose documents we checked. Older or smaller models can be much lower.
Anthropic's page lists these Claude models as having a 1M-token window: Claude Fable 5.2, 5.1 and 5, Claude Mythos 5.2, 5.1, 5 and Mythos Preview, Claude Opus 5.5, Opus 5, Opus 4.8, Opus 4.7, Opus 4.6, Claude Sonnet 5.5, Sonnet 5, Sonnet 4.6 and Claude Haiku 5.5. It says other Claude models have a 200k-token window. For these 1M models, Anthropic says 1M is the default with no beta header needed, and that a single request can generate up to 128k output tokens. It adds that long-context requests are billed at standard pricing except on Claude Haiku 5.5, where prompts over 100,000 tokens cost more.
On the Google side, the Gemini models page lists the Gemini 4 models Carbon, Neon, Hydrogen and Argon, each with "1M tokens" of context. The token page says the 1M window (1,048,576 tokens) is shared across input, thinking and output tokens.
| Vendor | Window stated in docs | What shares the window |
|---|---|---|
| Anthropic, listed 1M Claude models | 1M tokens, up to 128k output per request | Input, tool results, thinking and reply |
| Anthropic, other Claude models | 200k tokens | Same |
| Google, Gemini 4 models listed | 1M tokens (1,048,576) | Input, thinking and output |
These pages change, and neither shows a last-updated date. Before you build anything, check the current model list on the vendor's own documentation page. We have not compared other vendors here because we did not verify their documents.
How do I budget tokens? A worked example
Add up each part, then compare the total with the window. The numbers below are illustrative, for a made-up student project that asks a chatbot to review a codebase.
| Part | Tokens (illustrative) |
|---|---|
| System prompt | 800 |
| Chat history | 12,000 |
| Uploaded notes | 30,000 |
| Tool results | 5,000 |
| Reserved for the reply | 4,000 |
| Total | 51,800 |
Against a 1,048,576-token window, 51,800 uses under 5 percent, so there is plenty of room. Against a 200k window it uses about a quarter, which still fits. Now imagine the uploaded notes grow to 180,000 tokens: the total becomes 201,800, which no longer fits in a 200k window even though the notes alone did. The reply space and the history are what tip you over.
Does a bigger context window make answers better?
Not automatically. A bigger window lets you include more, but the model does not use every part equally well.
Anthropic's documentation states that as token count grows, accuracy and recall degrade, a phenomenon it calls context rot. That is why curating what goes in matters, not only how much fits.
Take a scenario. You paste a full 300-page PDF and ask about one clause. Your question is buried among hundreds of thousands of tokens the model does not need. Pasting only the 15 relevant pages gives the model less to sift through and costs less to process. When the source is too large to read by hand, a retrieval step can pull out the relevant pieces first. Our posts on what RAG is and RAG versus fine-tuning versus agents explain that approach.
Why does a chatbot forget what I said earlier?
There are two usual reasons. The chat may have outgrown the window, so older messages are cut or summarised by the app. Or you started a new chat, which begins with an empty window.
Which one it is depends on the product, and apps handle limits in different ways, so we do not claim one behaviour for all. What the docs do make clear is that the window is per request and everything in it is paid for in space. Long chats also cost more to process because the whole history is sent each turn. Whether an app remembers you across chats is a separate feature, which we cover in AI memory in chatbots.
A checklist for everyday use
- Start a new chat for a new topic. Old history takes space and can distract.
- Paste only the code or pages you need, not the whole project.
- When a long chat has grown, restate the key facts in one short message.
- Leave room for the reply. A long answer needs space too.
- Check the vendor's model page for the current window before relying on a number you read in a blog, including this one.
For a deeper look at how models are tested on long inputs, see LLM evaluation explained.
Next step
Run a small test this week. Take one real document, count its tokens with your tool's counter, ask the same question with the full text and with only the relevant section, and compare the answers. If you want to build AI projects with this kind of discipline, you can look at the large language models guide on this blog to continue.
Frequently asked questions
What is a context window in simple words?
It is the amount of text a model can work with in one request, measured in tokens. It includes your prompt, earlier messages, documents and the reply. Anthropic calls it the model's working memory.
What is a 1 million token context window?
It is a window of about one million tokens. Google's docs give 1,048,576 tokens shared across input, thinking and output. At 100 tokens per 60 to 80 English words, that is very roughly 600,000 to 800,000 words.
Does a bigger context window make answers better?
Not by itself. Anthropic says accuracy and recall degrade as token count grows, which it calls context rot. Sending only the relevant material usually works better than pasting everything.
What is a token, and how many words is it?
A token is a chunk of text. Google says about 4 characters make one token, and 100 tokens equal about 60 to 80 English words. Other languages and code may split differently.
What happens if my prompt is too long?
Through the API, Anthropic says the request fails with a 400 invalid_request_error, 'prompt is too long', if the input alone exceeds the window. Chat apps usually show their own message or trim history.
Why does a long chat get slower or more expensive?
Each turn sends the growing history again, and all of it counts toward the window. Anthropic notes that prompt caching changes the price of cached tokens but they still occupy the window.