# 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.

Canonical: https://promptlyfound.com/llms/context-windows
Updated: 2026-11-20

## Short answer

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.

## Key findings

- 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]
- 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]
- 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]
- Anthropic says accuracy and recall degrade as the token count in the context grows, and calls the effect context rot. [1]
- 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]

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](https://platform.claude.com/docs/en/build-with-claude/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](https://promptlyfound.com/llms/tokens), the units of text a model reads and writes. The [token counter](https://promptlyfound.com/tools/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](https://developers.openai.com/api/docs/guides/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](https://developers.openai.com/api/docs/models/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](https://ai.google.dev/gemini-api/docs/models/gemini-4-argon) lists a context window of 1,048,576 tokens as a "unified input and output token limit".[6] [Google's long context guide](https://ai.google.dev/gemini-api/docs/long-context) 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](https://ai.google.dev/gemini-api/docs/models/gemini-3.8-flash) lists an input token limit of 1,048,576 and an output token limit of 65,536.[7]

## Context window sizes by model

  <thead><tr><th scope="col">Model</th><th scope="col">Context window</th><th scope="col">Maximum input</th><th scope="col">Maximum output</th></tr></thead>
  <tbody>
    <tr><th scope="row">Claude Fable 5.2, Opus 5.5, Sonnet 5.5 and Haiku 5.5</th><td>1,000,000 tokens</td><td>Not listed separately</td><td>128,000 tokens[1]</td></tr>
    <tr><th scope="row">GPT-6.2 Astra and GPT-6.2 Sol</th><td>1,050,000 tokens</td><td>922,000 tokens</td><td>128,000 tokens[4][5]</td></tr>
    <tr><th scope="row">GPT-6.1 Terra and GPT-6 Luna</th><td>1.05 million tokens</td><td>Not listed on the models page</td><td>128,000 tokens[3]</td></tr>
    <tr><th scope="row">Gemini 4 Argon</th><td>1,048,576 tokens, shared by input, thinking and output</td><td>Shares the window</td><td>65,536 tokens by default, up to 1,048,576 with long decode[6]</td></tr>
    <tr><th scope="row">Gemini 3.8 Flash</th><td>Separate budgets</td><td>1,048,576 tokens</td><td>65,536 tokens[7]</td></tr>
  </tbody>

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](https://developers.openai.com/api/docs/models) lists 1.05 million tokens and 128,000 output tokens for its four flagship models.[3] The [GPT-6.2 Sol page](https://developers.openai.com/api/docs/models/gpt-6.2-sol) 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](https://support.claude.com/en/articles/8606394-how-large-is-the-context-window-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.[1][2] 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](https://arxiv.org/abs/2307.03172)". 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](https://promptlyfound.com/llms/how-llms-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](https://promptlyfound.com/ai-search/rag) explains the retrieval steps, and [grounding](https://promptlyfound.com/ai-search/grounding) explains how the answer links back to its sources.

Anthropic documents this in its [web search tool documentation](https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool). 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](https://support.claude.com/en/articles/10684626-enable-and-use-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](https://developers.google.com/search/docs/fundamentals/ai-optimization-guide). 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

> 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?](https://promptlyfound.com/llms/tokens) covers how text is counted and how much of a page developer search tools extract.

## Sources

1. Context windows. Claude Platform Docs. https://platform.claude.com/docs/en/build-with-claude/context-windows
2. Conversation state. OpenAI API documentation. https://developers.openai.com/api/docs/guides/conversation-state
3. Models. OpenAI API documentation. https://developers.openai.com/api/docs/models
4. GPT-6.2 Astra. OpenAI API documentation. https://developers.openai.com/api/docs/models/gpt-6.2-astra
5. GPT-6.2 Sol. OpenAI API documentation. https://developers.openai.com/api/docs/models/gpt-6.2-sol
6. Gemini 4 Argon. Google AI for Developers, 2026-10-30. https://ai.google.dev/gemini-api/docs/models/gemini-4-argon
7. Gemini 3.8 Flash. Google AI for Developers, 2026-10-30. https://ai.google.dev/gemini-api/docs/models/gemini-3.8-flash
8. Long context. Google AI for Developers. https://ai.google.dev/gemini-api/docs/long-context
9. Lost in the Middle: How Language Models Use Long Contexts. arXiv (Liu et al.), 2023-07-06. https://arxiv.org/abs/2307.03172
10. How large is the context window on paid Claude plans?. Claude Help Center. https://support.claude.com/en/articles/8606394-how-large-is-the-context-window-on-paid-claude-plans
11. Web search tool. Claude Platform Docs. https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool
12. Enable and use web search. Claude Help Center. https://support.claude.com/en/articles/10684626-enable-and-use-web-search
13. Optimizing your website for generative AI features on Google Search. Google Search Central, 2026-07-10. https://developers.google.com/search/docs/fundamentals/ai-optimization-guide

---

This is a plain-text copy of https://promptlyfound.com/llms/context-windows from Promptly Found. The web page is the canonical version and includes the charts.
