What is a context window?
A context window is the number of tokens a model can read and write in one request. Sizes from Anthropic, OpenAI and Google, and what happens at the limit.
In short. A context window is the number of tokens a model can read and write in one request. The instructions, the conversation so far, any documents or search results and the answer itself all count toward it. Current flagship models from Anthropic, OpenAI and Google have windows of about 1 million tokens. A model does not use every part of a long context equally well.
On this page 11 sections
The evidence
Anthropic says everything in a request counts toward the context window: the system prompt, every message, tool results, documents, tool definitions and the output Claude generates, including its thinking.1
1Claude Platform DocsAnthropic, Context windows, checked Nov 20, 2026.OpenAI lists GPT-6.2 Astra with a context window of 1,050,000 tokens, a maximum input of 922,000 tokens and a maximum output of 128,000 tokens.4
4OpenAI API documentationOpenAI API documentation, checked Nov 20, 2026.Gemini 4 Argon shares one window of 1,048,576 tokens across input, thinking and output. If input plus the requested output would exceed it, the API lowers the output limit to the space that remains.8
8Google AI for DevelopersGoogle AI for Developers, Long context, checked Nov 20, 2026.Anthropic says accuracy and recall degrade as the token count in the context grows, and calls the effect context rot.1
1Claude Platform DocsAnthropic, Context windows, checked Nov 20, 2026.In tests of 2023 models, performance was often highest when the relevant information sat at the start or end of a long context, and dropped when it sat in the middle.9
9arXiv (Liu et al.)Liu et al., arXiv, Jul 6, 2023. Multi-document question answering and key-value retrieval.An AI search answer can cite only what reaches the model's context window. Current flagship models from Anthropic, OpenAI and Google hold about 1 million tokens each, and they still use a long context less reliably as it fills. A context window is the amount of text, counted in tokens, that a language model can work with in one request. Anthropic's documentation on context windows defines it as all the text a model can reference when it generates a response, including the response itself. Anthropic describes it as the model's working memory, separate from the data the model was trained on.1 Text that is not in the window is not available to the model for that answer.
The window is measured in tokens, the units of text a model reads and writes. The token counter shows how many tokens a passage uses.
#What counts toward the context window
Your page competes for window space with the instructions, the conversation and every other source in the request. Every part of a request uses space in the window. Anthropic lists the system prompt, every message in the conversation (including tool results, images and documents) and the tool definitions. The output the model generates for the turn counts too, and so does its extended thinking.1
OpenAI's guide to conversation state gives the same definition: the context window is the maximum number of tokens that can be used in a single request, including input, output and reasoning tokens.2
In a conversation, the window fills turn by turn. Anthropic says each user message and each response stays in the window, and each response becomes part of the input for the next turn.1 A long chat therefore uses more of the window with every exchange, even when each new question is short.
#Input limits and output limits
The headline window size overstates how much source text a model can take in, because part of the window is kept for the answer. Providers publish two or three numbers for each model, and they measure different things:
- The context window is the total for one request: input plus output.
- The maximum output is the most tokens the model can generate in one response.
- Some providers also publish a maximum input, the most tokens the prompt alone can contain.
OpenAI's page for GPT-6.2 Astra shows all three: a context window of 1,050,000 tokens, a maximum input of 922,000 tokens and a maximum output of 128,000 tokens.4 The prompt alone cannot fill the window, because room is kept for the answer.
Google publishes two layouts. The Gemini 4 Argon model page lists a context window of 1,048,576 tokens as a "unified input and output token limit".6 Google's long context guide says that window is shared across input, thinking and output tokens. Earlier Gemini 3 and 2.5 models use separate input and output budgets, which Google gives as 1M and 64K tokens.8 The Gemini 3.8 Flash page lists an input token limit of 1,048,576 and an output token limit of 65,536.7
#Context window sizes by model
| Model | Context window | Maximum input | Maximum output |
|---|---|---|---|
| Claude Fable 5.2, Opus 5.5, Sonnet 5.5 and Haiku 5.5 | 1,000,000 tokens | Not listed separately | 128,000 tokens1 |
| GPT-6.2 Astra and GPT-6.2 Sol | 1,050,000 tokens | 922,000 tokens | 128,000 tokens45 |
| GPT-6.1 Terra and GPT-6 Luna | 1.05 million tokens | Not listed on the models page | 128,000 tokens3 |
| Gemini 4 Argon | 1,048,576 tokens, shared by input, thinking and output | Shares the window | 65,536 tokens by default, up to 1,048,576 with long decode6 |
| Gemini 3.8 Flash | Separate budgets | 1,048,576 tokens | 65,536 tokens7 |
Anthropic, OpenAI and Google all list windows of about 1 million tokens for their current flagship models, so window size does little to separate them. Anthropic's context window page lists 1 million tokens for Claude Fable 5.2, Opus 5.5, Sonnet 5.5 and Haiku 5.5, and up to 128,000 output tokens per request. It says other Claude models, including Claude Sonnet 4.5, have a window of 200,000 tokens.1 OpenAI's models page lists 1.05 million tokens and 128,000 output tokens for its four flagship models.3 The GPT-6.2 Sol page gives the same limits as GPT-6.2 Astra.5
Google's long context guide says early generative models could process 8,000 tokens at a time, and later models 32,000 or 128,000 tokens.8 The windows in Table 1 are larger by about two orders of magnitude.
#Context windows in chat apps
A prompt test run in a consumer chat app can behave differently from the same model in the API, because the window in a consumer app can be smaller. Anthropic's help article on context windows on paid Claude plans lists 500,000 tokens for Claude Opus 4.6 when chatting with Claude, and 1 million tokens for the same model in Claude Code.10 The API documentation lists 1 million tokens for Claude Opus 4.6.1
Chat apps also manage the window for the user. Anthropic says that on paid plans with code execution turned on, Claude summarizes earlier messages when a conversation approaches the limit, so the conversation can continue.10 Its API documentation notes that chat interfaces such as claude.ai can manage the window on a rolling "first in, first out" basis.1
#When content does not fit
Content that does not fit is refused, trimmed or truncated, depending on the provider, which is why applications summarize, clear or retrieve content instead of loading everything. Each provider documents what its API does at the limit:
- Anthropic returns an error ("prompt is too long") if the input alone exceeds the window. If the input fits but the answer reaches the limit, Claude 4.5 and newer models stop with the stop reason
model_context_window_exceeded.1 - Google caps the output. If input tokens plus the requested maximum output exceed 1,048,576 on Gemini 4 Argon, the API lowers the output limit to the space left in the window.8
- OpenAI warns that a large prompt can exceed the window and produce truncated outputs, and that tokens generated beyond the limit may be truncated in API responses.2
Applications work around the limit in three documented ways. Server-side compaction summarizes earlier parts of a conversation so it can continue past the limit. Anthropic and OpenAI both offer it.12 Context editing clears old tool results or thinking blocks.1 Retrieval loads only the relevant part of a large collection. Anthropic says Claude Projects use retrieval-augmented generation, so Claude can work with more information by loading only relevant content into the window.10
#How models use a long context
A page that reaches the window can still be underused, because models do not read every token with the same care. Anthropic's documentation says more context is not automatically better. As the token count grows, accuracy and recall degrade, an effect Anthropic calls context rot.1
The position of information also matters. In 2023, researchers led by Nelson F. Liu published "Lost in the Middle: How Language Models Use Long Contexts". They tested models on multi-document question answering and on retrieving a value for a key from a long list.9 The abstract reports:
"performance is often highest when relevant information occurs at the beginning or end of the input context, and significantly degrades when models must access relevant information in the middle of long contexts, even for explicitly long-context models."
The study tested models available in 2023, which had much smaller windows than those in Table 1. How large language models work describes the study in more detail.
Google's long context guide describes a related limit. Gemini models score high on tests that look for a single fact (a "needle") in a long context. Google says accuracy is lower when the model must find several facts, and that performance can vary widely with the context.8 Google also advises putting the question at the end of a long prompt, after all the other context.8
#Context windows in AI search
In AI search, only the parts of your page that get extracted can be cited. An AI search system does not put whole websites into the window. It runs searches, picks results and passes extracts of them to the model along with the question. Retrieval-augmented generation explains the retrieval steps, and grounding explains how the answer links back to its sources.
Anthropic documents this in its web search tool documentation. Claude decides when to search, the API runs the searches and returns results, and the cycle can repeat several times in one request.11 With basic web search, every search result is loaded into Claude's context window, and Anthropic says much of that content can be irrelevant. With newer tool versions, Claude can write and run code that filters the results first, so only relevant content reaches the window.11 Search results count as input tokens, in the turn where they are retrieved and in later turns.11
A fetched page takes more room than a search result. Anthropic's help article on web search says that when a user asks Claude for a summary of a linked article, the entire article is retrieved into the context window. Its example is a 10,000-word article, which uses substantially more of the window than a regular web search query.12
Google describes the retrieval step for AI Overviews and AI Mode in its guide to generative AI features in Search. Its systems retrieve relevant pages from the Search index and then review specific information from those pages to generate a response. The same guide says Google's systems understand several topics on one page and show the relevant piece to users.13 Google does not publish how many tokens from each page reach the model in these features.
#Writing for the context window
Method.The points below follow from the documented limits and from the lost-in-the-middle tests. No AI search provider has published a test of them on web pages.
- State a section's main fact in its first sentence, so the fact still reaches the model when a system passes on only part of the page.
- Name the subject in each passage, so a model that sees only an extract can understand the passage without the paragraphs around it.
- Keep navigation text, repeated boilerplate and introductions short. In a fetched page they use tokens and add nothing to an answer, so trimming them leaves more of the window for your facts.
What are tokens in AI? covers how text is counted and how much of a page developer search tools extract.
Read next
LLMs
What are tokens in AI?
A token is the unit of text a language model reads and writes. OpenAI estimates that 100 tokens are about 75 English words. Counts and limits by provider.
LLMs
How do large language models work?
LLMs predict text one token at a time from what fits in their context window. Tokens, context window sizes and the lost-in-the-middle effect.
AI search
What is retrieval-augmented generation (RAG)?
RAG retrieves documents at query time and gives them to a language model to write a cited answer. How ChatGPT, Claude, Google, Bing and Perplexity use it.
AI search
What is grounding in AI?
Grounding gives a model sources at answer time so it can answer from them and cite them. How Google, Microsoft, OpenAI, Anthropic and Perplexity define it.
Questions
How big is a context window?
On November 20, 2026, Anthropic lists 1 million tokens for its current Claude models, OpenAI lists 1.05 million for its flagship GPT models, and Google lists 1,048,576 for Gemini 4 Argon. Consumer apps can set a smaller window than the API for the same model.
What happens when a conversation exceeds the context window?
The API rejects a prompt that is larger than the window. If the prompt fits but the answer runs out of room, the output stops or is cut short. Chat apps such as Claude can summarize earlier messages so that a conversation can continue.
Is the context window the same as a model's memory or training data?
No. Training data is what the model learned before release. The context window holds only the text of the current request. Anthropic calls it the model's working memory. Text outside the window is not available to the model.
Does a larger context window replace retrieval?
No provider says so. Google says larger windows allow more information to be given up front, and also that accuracy drops when a model must find several facts in a long context. Anthropic says more context is not automatically better. AI search systems still retrieve selected passages.
Notes
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
About this page
Researched and reviewed by Promptly Found. Reviewed Nov 20, 2026. Next review due Feb 2027.
Cite this page
Promptly Found. (2026, November 20). What is a context window? https://promptlyfound.com/llms/context-windows
Revisions 1
- First published.