What Is a Context Window? AI Meaning, Explained
Context window, demystified: what it means, why bigger isn't always better, and how Claude, GPT, Gemini, Grok and DeepSeek stack up today.

A context window is the total amount of text an AI model can hold in view at once, measured in tokens, covering everything in a request — system instructions, chat history, documents, tool definitions and the model's own reply. Today's flagship models range from roughly 400,000 tokens (GPT-5.1) up to just over 1 million tokens (Claude's current lineup, Gemini 4 Argon, DeepSeek's V4 models, and some Grok variants) — but a bigger number doesn't automatically mean better answers, because accuracy tends to degrade as a prompt fills more of the window.
Context window, in short:
- Measured in tokens (roughly ¾ of a word each in English), not characters or pages.
- It covers the entire request: system prompt, chat history, pasted documents, tool definitions and the model's generated output — not just what you type.
- Current flagship windows run from about 400,000 tokens (OpenAI's GPT-5.1) to roughly 1,048,576 tokens (Google's Gemini 4 Argon, Anthropic's current Claude models, and DeepSeek's V4 line).
- Performance can still drop well before the window fills up — a pattern Anthropic calls "context rot."
What is a context window, exactly?
Every large language model answers a prompt by looking at a fixed-size block of tokens — its context window — and predicting what comes next. Anthropic's developer documentation on context windows describes it as "all the text a language model can reference when generating a response, including the response itself," and distinguishes it from the much larger corpus of data the model was trained on. The context window is closer to working memory than to long-term knowledge: it's the stretch of text the model can actually "see" while it's composing an answer, not everything it has ever learned.
That means a context window is not a static setting you configure once. It fills up turn by turn in a conversation, or all at once if you paste in a long document or point an agent at a large codebase. Once the input plus whatever the model needs to generate exceeds the window, something has to give — older messages get dropped, the request gets rejected, or the model simply can't take in anything new.
How context windows are measured: tokens, not words
Context windows are sized in tokens, the sub-word units a model actually processes. A token is often a fraction of a word, a whole short word, or a piece of punctuation — in English, a rough rule of thumb is that 1,000 tokens is about 750 words, though Anthropic notes this ratio itself changes as tokenizers evolve. Anthropic's model comparison documentation points out that with the tokenizer introduced alongside Claude Opus 4.7, 1 million tokens maps to roughly 555,000 words or 2.5 million Unicode characters, whereas models before that tokenizer fit closer to 750,000 words into the same million-token budget. In other words, even "1 million tokens" isn't a perfectly fixed amount of English prose — it depends on exactly how a given model's tokenizer slices up text, and non-English text, code, and dense symbols often tokenize less efficiently than plain English prose.
This is also why providers quote token limits rather than page or word counts: tokens are the unit the model's architecture actually operates on, and the only measurement that stays consistent across languages, code and formatted documents.
What actually counts against the window
It's easy to assume the context window only covers what a person types, but every component of a request draws from the same pool. Per that same context-window documentation, it includes the system prompt, every message in the conversation (including tool results, images and documents), the tool definitions made available to the model, and the output the model generates for that turn — including any extended "thinking" tokens. The Claude API reports exactly what a request consumed in its response's usage field, split across input tokens, cached input tokens and output tokens where prompt caching is in play.
The practical effect is that a long system prompt, a big toolbelt of function definitions, or a handful of large images can quietly eat into the same budget available for your actual question — which is one reason agentic tools that call many tools in a loop can burn through a context window far faster than a simple back-and-forth chat.
Why a bigger context window isn't automatically better
It's tempting to treat context window size as a straightforward scoreboard, but providers themselves warn against that. Anthropic's own guidance, in a companion engineering post on effective context engineering, states plainly that "a larger context window allows the model to handle more complex and lengthy prompts, but more context isn't automatically better. As token count grows, accuracy and recall degrade, a phenomenon known as context rot." That makes curating what you put into the window — trimming irrelevant history, summarizing earlier turns, pulling in only the relevant files — just as important as how much room is technically available.
This is part of why techniques like retrieval, summarization and deliberate prompt structuring have become their own discipline; distinguishing what belongs in the model's immediate context from what it should fetch on demand is the core idea behind context engineering, as distinct from prompt engineering. Anthropic also now offers server-side "compaction," which automatically summarizes earlier parts of a long-running conversation so an agent can keep working past what would otherwise be a hard limit, rather than simply erroring out or losing early context.
How Claude, GPT, Gemini, Grok and DeepSeek compare
Context window sizes move quickly and differ by model tier, but based on each company's own current documentation, the flagship-class API figures as of November 2026 look like this:
| Model family | Flagship model(s) | Context window | Max output per request |
|---|---|---|---|
| Anthropic Claude | Claude Opus 5.5, Sonnet 5.5, Fable 5.1 and other current-generation models | 1,000,000 tokens | 128,000 tokens |
| OpenAI GPT | GPT-5.1 (API) | 400,000 tokens | 128,000 tokens |
| Google Gemini | Gemini 4 Argon | 1,048,576 tokens (shared input/output) | 65,536 tokens by default; up to 1,048,576 with long decode |
| xAI Grok | Grok 4.7 (flagship); Grok 4.3 and the 4.20 line | 500,000 tokens (4.7); 1,000,000 tokens (4.3, 4.20 variants) | Not published by xAI |
| DeepSeek | DeepSeek-V4-Pro, DeepSeek-V4.1-Flash | 1,000,000 tokens | 384,000 tokens |
A few things stand out. Anthropic's current Claude lineup — including Opus 5.5 and Sonnet 5.5 — ships a 1-million-token context window by default, with no beta header or long-context surcharge required; that's a change from the Claude Sonnet 4 era, when the same million-token ceiling first shipped as an opt-in beta feature. OpenAI's own GPT-5.1 model page sits lower, at 400,000 tokens for the API model. Google's Gemini 4 Argon model page and DeepSeek's published API pricing and limits for its V4 line both advertise roughly a million tokens, though Gemini's figure is a single pool shared between input and output rather than two separate allowances. xAI's lineup is the most fragmented: its current flagship, Grok 4.7, tops out at 500,000 tokens, while older Grok 4.3 and the newer 4.20 variants are listed at a full million on xAI's own models page — a reminder that within a single company's catalog, the "flagship" model and the "largest context window" model aren't always the same model. For a closer look at one of those variants, xAI's own breakdown of Grok 4.7's context window and pricing is worth reading alongside this comparison.
It's also worth separating the API figures above from what a consumer chat app actually gives you. Anthropic's documentation notes that interfaces like Claude's own chat app can manage context on a rolling "first in, first out" basis rather than exposing the full window, and that behavior varies by plan and product. The token ceiling quoted in a company's model documentation describes what developers can request through the API — not necessarily what every consumer-facing chat surface makes available by default.
Context window vs. training data: two different things
It's a common mix-up: a model's context window is not the same as its training data or "knowledge." The training data (and the more specific "reliable knowledge cutoff" that vendors now publish) determines what facts and events a model learned about during training and can recall without being told. The context window, by contrast, is the working space available during a single conversation or request — it determines how much you can hand the model directly, right now, regardless of what it already knows. A model with an older knowledge cutoff but a huge context window can still reason accurately about this morning's news, as long as you paste the relevant text into the conversation; the context window is what makes that possible.
What this means for long documents, codebases, chat history and cost
For most everyday use, context window size translates into a few very concrete limits:
- Long documents: A contract, research paper or book chapter that runs to tens of thousands of words can now fit entirely into a single request on a 1-million-token model, where it might have needed splitting into chunks on a 128,000-token model from a couple of years ago. Whether the model actually reasons well across all of it is a separate question from whether it technically fits.
- Codebases: Feeding an AI coding agent an entire repository, rather than a few relevant files, uses the context window as a kind of extended short-term memory — useful for cross-file reasoning, but also the fastest way to fill the window with code the model doesn't need for the task at hand. This is one reason AI agents that work over long, multi-step tasks increasingly rely on summarization and selective retrieval rather than just loading everything up front.
- Chat history: In a long-running conversation, every prior turn — your messages and the model's replies — stays in the window unless something actively trims it. That's why very long chats can start to feel slower or less sharp: the model is working with a progressively fuller, and sometimes noisier, context.
- Cost: API pricing is charged per token, for both input and output, so a larger context window is also a larger potential bill if you fill it. Anthropic's announcement of general availability for its 1-million-token window notes that standard rates now apply across the full window with no long-context premium for current models, which wasn't always the case; other providers may still price long-context requests differently, so it's worth checking current pricing pages before assuming a flat rate.
How providers help you work around the limits
Because context rot is a real constraint and not just a theoretical one, model providers have started shipping features that manage the window automatically rather than leaving it entirely to the user. Anthropic's server-side compaction summarizes earlier parts of a long conversation so an agent can keep going past what would otherwise be a hard wall. Its API also supports more granular "context editing," such as clearing old tool results or stale reasoning ("thinking") blocks that are no longer needed but would otherwise sit in the window taking up space. Google's Gemini 4 Argon offers an optional "long decode" mode that reallocates its shared token pool toward a much larger output when a task calls for it. None of these tools make the underlying window bigger — they help ensure that whatever room is available gets used on the information that actually matters for the task.
What to check before you pick a model by context window alone
Context window size is an easy number to compare, but it's rarely the only one that matters. Before choosing a model purely because it advertises the largest window, it's worth checking: whether the vendor's quoted figure is an API limit or a smaller consumer chat-app limit; whether output tokens share the same pool as input tokens (as with Gemini) or are a separate allowance (as with Claude and GPT); whether long-context requests carry a pricing premium; and whether your actual task — a short chat, a document summary, a full-repository coding session — would ever realistically approach the limit in the first place. For the majority of day-to-day prompts, the gap between a 400,000-token window and a 1-million-token one will never be the bottleneck; recall, reasoning quality and cost usually matter more. Checking a vendor's own current model page before building anything that depends on an exact figure is always worth the extra minute, since these numbers change with almost every model release.
Frequently asked questions
What is a context window in AI, in simple terms?
It's the amount of text — measured in tokens — that an AI model can take in and respond to in a single request. It covers the system prompt, the conversation so far, any documents or tool outputs, and the model's own reply, all drawing from one shared budget.
How is a context window measured?
In tokens, not words or characters. A token is typically a fraction of a word in English. As a rough guide, 1,000 tokens is about 750 words, though the exact ratio depends on the model's tokenizer and the language or content type involved.
Which AI model has the largest context window right now?
Among current flagship-class models, Google's Gemini 4 Argon and Anthropic's current Claude models (such as Opus 5.5 and Sonnet 5.5) both advertise roughly 1,048,576 or 1,000,000 tokens, as does DeepSeek's V4 line, according to each company's own documentation. OpenAI's GPT-5.1 and xAI's flagship Grok 4.7 publish smaller windows, at 400,000 and 500,000 tokens respectively.
Does a bigger context window always mean better answers?
No. Anthropic's own documentation describes a pattern it calls "context rot," where accuracy and recall can degrade as a prompt fills more of the window, even though more room is technically available. Curating what goes into the context often matters as much as how much space there is.
Is a model's context window the same as its training data?
No — they're different concepts. Training data (and a model's knowledge cutoff) is what the model learned during training and can recall unprompted. The context window is the working space available during a single conversation, which can include fresh information you paste in directly, regardless of the model's training cutoff.
Does the context window in a chat app match the API limit a company publishes?
Not necessarily. Anthropic's documentation notes that consumer chat interfaces can manage context on a rolling, first-in-first-out basis rather than exposing the full API-level window, so the token ceiling quoted on a model's developer page describes what's available through the API, not necessarily every consumer chat surface.
Sources
- Anthropic — Context windows (developer documentation)platform.claude.com
- Anthropic — Models overview and comparison tableplatform.claude.com
- OpenAI — GPT-5.1 model pagedevelopers.openai.com
- Google AI Studio — Gemini 4 Argon model pageaistudio.google.com
- xAI — Models documentationdocs.x.ai
- DeepSeek — API pricing and model limitsapi-docs.deepseek.com
Theo Park runs the AI desk at Pandromeda. He follows model launches from the frontier labs and the open-weight community, tracks the assistants and developer tools built on them, and explains what each release changes on pricing, capability and safety. His reporting leans on primary sources: model cards, technical reports, API documentation and the companies' own announcements.


