What is a context window in AI, and why does it matter?
What is a context window? It's the maximum amount of text, measured in tokens, that an AI model can work with in a single request: your prompt, the conversation so far, any files you attach and the reply it writes. Anything that doesn't fit, the model can't use.

The short version
- A context window is an AI model's working memory. It is separate from the much larger body of data the model was trained on.
- It is measured in tokens. OpenAI says 1 token is about 4 characters of English text, or about three-quarters of a word.
- Everything counts against it: instructions, chat history, uploaded documents, the model's reasoning and its answer.
- Leading models from OpenAI, Google and Anthropic now offer windows of about 1 million tokens through their developer platforms. Chat apps often give you less, depending on the plan.
- Bigger isn't automatically better. Anthropic says accuracy and recall degrade as the token count grows, and IBM says models struggle with information buried in the middle of long inputs.
What is a context window in AI, in simple terms?
A large language model doesn't remember your conversation the way a person does. Each time it answers, it reads everything in front of it again: the instructions it was given, every earlier message and the new question. That bundle of text is the context, and the context window is the limit on how big it can be.
Anthropic's documentation describes the context window as “all the text a language model can reference when generating a response, including the response itself.” It stresses that this is different from the training data and calls it the model's “working memory.” Google uses a similar comparison, calling the context window a form of short-term memory, with “a limited amount of information” it can hold.
IBM defines it as “the amount of text, in tokens, that the model can consider or ‘remember’ at any one time.”
Tokens: how a context window is measured
Context windows are measured in tokens, not words or pages. A token is a chunk of text: sometimes a whole word, sometimes part of one, sometimes a punctuation mark.
OpenAI's rule of thumb for English is that 1 token is about 4 characters, or about three-quarters of a word. By the same estimate, 100 tokens are about 75 words. Google gives similar figures for Gemini: about 4 characters per token, and 60 to 80 English words per 100 tokens. OpenAI calls its figures estimates, not exact counts, and notes that the same text can produce different token counts depending on the model and the language.
Images, audio and video use tokens too. For Gemini, Google says a small image counts as 258 tokens and audio uses 32 tokens per second, so an hour of audio alone comes to more than 100,000 tokens.
What counts toward the context window
More goes into the window than the message you type. According to Anthropic's developer documentation, the total includes:
- Instructions. The system prompt the app or developer sets.
- Conversation history. Every earlier question and answer in the chat. Anthropic says each turn accumulates and earlier turns are kept in full.
- Attachments and tool results. Documents, images and anything a tool or search returns. Anthropic also counts the definitions of the tools a model can use.
- Reasoning. Models that “think” before answering use reasoning tokens, and OpenAI and Anthropic both count those against the window.
- The answer. The reply the model writes takes space in the same window.
OpenAI's documentation also counts input, output and reasoning tokens toward the window.
OpenAI's ChatGPT pricing page makes the same point for consumers: it says the window is shared with instructions, memory and the model's own processing, so the space left for your input is smaller than the total.
How big are context windows?
Context windows have grown fast. IBM says the GPT-3.5 model behind ChatGPT's launch had a maximum context length of 4,096 tokens. Google says earlier generative models “were only able to process 8,000 tokens at a time.”
The current developer figures, as each company lists them:
| Model | Context window | Notes from the vendor |
|---|---|---|
| OpenAI GPT-6.2 Astra | 1,050,000 tokens | Up to 922,000 input tokens and 128,000 output tokens |
| Google Gemini 4 | 1,048,576 tokens | Shared across input, thinking and output |
| Google Gemini 3 and 2.5 | 1M input tokens | Separate 64K output budget |
| Anthropic Claude Opus 5.5, Sonnet 5.5, Haiku 5.5 and other recent models | 1 million tokens | Up to 128,000 output tokens per request; older Claude models have 200,000 |
To put 1 million tokens in perspective, Google says it's roughly 50,000 lines of code, 8 average-length English novels or the transcripts of more than 200 average-length podcast episodes.
These figures change with almost every model release, so check the vendor's model page for the version you use.
The context window in ChatGPT and Claude
Chat apps don't always give you the full developer figure. At the time of writing, OpenAI's ChatGPT pricing page lists a total context window for its Instant mode of 27K tokens on the Free plan, 54K on Go or Plus and 128K on Pro. For its Reasoning mode, it lists 256K on Go and Plus, 400K on Pro and “Varies” on Free.
Anthropic's help center says its newest models, including Claude Opus 5.5 and Sonnet 5.5, have a 1-million-token context window in chat on paid plans, while some older models get 500,000 tokens and the rest 200,000. Claude Code has its own list of models and limits.
What happens when the context window is full?
It depends on the product. Through the developer platforms, an oversized request is either rejected or its output is cut off. Anthropic's API returns a “prompt is too long” error if the input alone exceeds the window, and OpenAI warns that output beyond the limit may be truncated.
Chat apps usually manage this for you. Anthropic says chat interfaces such as claude.ai can drop the oldest material on a rolling “first in, first out” basis. On paid Claude plans with code execution turned on, Anthropic says Claude instead “summarizes earlier messages to make room for new content,” which lets most conversations keep going.
Is a bigger context window always better?
No. A larger window lets a model take in tens of thousands of lines of code, a long contract or hours of transcripts at once, but more context brings its own problems.
- Context rot. Anthropic says that “as token count grows, accuracy and recall degrade,” a problem it calls context rot. Its engineers argue that context should be treated as “a finite resource with diminishing marginal returns.”
- Lost in the middle. IBM cites a 2023 study finding that performance “degrades when the model must carefully consider the information in the middle of long contexts.” Models do best with information near the start or end.
- Many facts at once. Google says Gemini can reach about 99% accuracy when looking for a single piece of information in a long context, but doesn't perform with the same accuracy when looking for several.
- Cost and speed. IBM says compute requirements scale quadratically with sequence length: double the input tokens and the model needs 4 times the processing power. Long prompts also cost more on pay-per-token APIs.
- Security. IBM cites Anthropic research finding that a longer window also makes a model more vulnerable to jailbreaking, which can lead to harmful output.
How to work within a context window
The vendors' own advice comes down to sending less, but better, context:
- Share only what's needed. Anthropic's engineers recommend finding “the smallest set of high-signal tokens” that gets the result you want. Our guide to prompt engineering covers how to write tighter prompts.
- Use retrieval for large collections. Retrieval-augmented generation (RAG) fetches only the relevant passages instead of loading everything. Anthropic says Claude projects use retrieval in a similar way.
- Summarize long work. Anthropic offers automatic compaction, which summarizes earlier parts of a conversation so it can continue.
- Turn off tools you don't need. Anthropic says connected tools and connectors use a lot of tokens.
For developers, Google recommends context caching for long contexts that are reused, and both Google and Anthropic offer token-counting tools to measure a request before sending it.
Frequently asked questions
What does a context window mean in an LLM?
In a large language model, the context window is the maximum number of tokens the model can use in one request. OpenAI says that number includes input, output and reasoning tokens. It's the model's working memory, not its training data.
What is a context window in Claude?
Anthropic says its recent Claude models, including Opus 5.5 and Sonnet 5.5, have a 1-million-token context window on its developer platform, and older models have 200,000 tokens. In the Claude apps, the size depends on the model and plan.
What is the context window of free ChatGPT?
At the time of writing, OpenAI's pricing page lists 27K tokens for the Instant mode on the Free plan and says the Reasoning mode's window varies. OpenAI notes that part of the window goes to instructions and memory, so less is left for your input.
Context window vs context length: is there a difference?
The terms are used interchangeably. IBM, for example, describes GPT-3.5's limit as a “maximum context length” of 4,096 tokens, which is the same thing as its context window.
Does the context window reset?
Not within a conversation. Anthropic says each message and reply accumulates in the window and earlier turns are kept in full. Once the window fills, chat apps drop or summarize the oldest material rather than clearing everything, depending on the app.
Why do LLMs have context windows?
Processing text takes computing power, and IBM says the compute needed grows quadratically with the length of the input. Even within the limit, Anthropic says accuracy and recall degrade as the token count grows.
More in AI
- What is a large language model (LLM), and how does it work?
- What is AI hallucination, and why does AI make things up?
- What is an AI agent, and how does it work?
- What is generative AI, and how does it work?
- What is machine learning, and how does it work?