On this page
- What is a context window?
- What counts toward the context window?
- Tokens, briefly
- How does a context window work in a chat?
- How big are context windows in 2026?
- In the APIs
- In the chat apps
- How context windows got this big
- Why don't AI models have unlimited context?
- Is a bigger context window always better?
- What happens when you hit the context window limit?
- Do bigger context windows cost more?
- How to get more out of a context window
- Frequently asked questions
A context window is the most an AI model can take in and work with at one time, measured in tokens: your messages, any files or images you add, the app's hidden instructions and the reply the model is writing. Anything past that limit is invisible to the model. In November 2026, the flagship models from Anthropic, OpenAI and Google each accept about 1 million tokens through their APIs, which works out to roughly 555,000 to 750,000 English words depending on the tokenizer.
The chat apps you actually use are often much smaller. OpenAI's pricing page lists 27K tokens for ChatGPT Free's Instant model and 54K on Plus, Gemini gives you 32K without a paid plan, and Claude's newest models get 1 million on paid plans. This guide covers what fills a context window, how big they are now, why a full one gets worse before it runs out, and what you can do about it.
What is a context window?
Think of it as the model's working memory for a single request. Anthropic's documentation describes it as all the text a model can refer to while it writes a response, including the response itself, and draws a clear line between that and the huge body of data the model was trained on. Google's Gemini help pages compare it to reading capacity: how much the model can understand together at one time.
That line matters. What a model learned in training is baked into its weights. What's in the context window exists only for the current request. When a chatbot seems to remember something you said ten messages ago, it's because the app sent those ten messages back to the model along with your new one. If you're new to how these models work at all, our guide to what a large language model is covers the basics.
What counts toward the context window?
More than your own typing. Anthropic's docs list everything in a request as counting toward the limit:
- The system prompt, the instructions an app or developer gives the model before you say anything.
- The whole conversation so far, both your messages and the model's replies.
- Files, images and documents you attach. Gemini 4 models also take audio and video, which are counted in tokens too.
- Tool definitions and tool results, such as web search results or the contents of a file an agent opened.
- The model's thinking, on models that reason before answering. Anthropic says thinking tokens count toward the window and are billed as output.
- The reply itself, which has to fit in the same space.
Coding agents show how quickly this adds up. Claude Code's documentation walks through a sample session in which the system prompt, memory and CLAUDE.md files, tool names and skill descriptions take about 7,850 tokens before you type a word. By the end of a short session with four file reads, two edits, a test run and one follow-up question, it's past 22,000.
Tokens, briefly
Context windows are counted in tokens, the chunks of text a model reads and writes, not in words or pages. OpenAI's rule of thumb for English is that one token is about four characters, or three quarters of a word, so 100 tokens is about 75 words and 1 million tokens is about 750,000 words.
The ratio depends on the model. Anthropic says the tokenizer it introduced with Claude Opus 4.7 produces about 30% more tokens for the same text, so 1 million tokens holds roughly 555,000 words on its newest models, against about 750,000 on older ones. Other languages, code and images all tokenize differently, so treat any words-per-token figure as an estimate. Our guide to what tokens are in AI and how they're counted goes deeper.
How does a context window work in a chat?
Every time you send a message, the app sends the model the entire conversation again: the system prompt, every earlier message and reply, any files, then your new message. The model reads all of it, writes a reply, and that reply joins the pile for the next turn. Anthropic's docs describe each turn being kept in full as the conversation goes on.
So a conversation's footprint only grows. A 40-message chat about a 100-page contract carries the whole contract and all 40 messages on every single turn.
The reply shares the same space. OpenAI's GPT-6.2 models have a window of 1,050,000 tokens, but OpenAI caps the input at 922,000 so there's room for the maximum 128,000-token answer. Google says the 1 million tokens on its Gemini 4 models are shared across input, thinking and output, and if your input plus the output you asked for won't fit, the API trims the output to whatever space is left.
How big are context windows in 2026?
In the APIs
These are the limits developers get when they call the models directly.
| Model | Context window | Max output per request | Worth knowing |
|---|---|---|---|
| Claude Fable 5.2, Opus 5.5, Sonnet 5.5 and Haiku 5.5 | 1M tokens | 128K tokens | Older models such as Sonnet 4.5 and Haiku 4.5 have 200K |
| GPT-6.2 Astra and GPT-6.2 Sol | 1,050,000 tokens | 128K tokens | Input is capped at 922,000 tokens |
| Gemini 4 Carbon, Neon, Hydrogen and Argon | 1M tokens, shared by input, thinking and output | 64K by default; Google's "long decode" can use whatever space the input leaves, up to 1M | Takes text, images, audio, video and PDFs |
| DeepSeek V4-Pro | 1M tokens | DeepSeek's API page lists up to 384K | Open weights under the MIT license |
Models you run on your own computer are a different story, because the window you get depends on your hardware. Ollama, a popular app for running models locally, defaults to a 4K context on machines with under 24 GB of video memory, 32K between 24 and 48 GB, and 256K above that, and it warns that a bigger context needs more memory. Our guide to running an LLM locally shows how to raise it.
In the chat apps
| App and plan | Context window |
|---|---|
| ChatGPT Free | 27K tokens on Instant; OpenAI lists reasoning as "varies" |
| ChatGPT Go and Plus | 54K on Instant, 256K on reasoning models |
| ChatGPT Pro | 128K on Instant, 400K on reasoning models |
| Claude paid plans (Pro, Max, Ultra, Team, Enterprise) | 1M on the newest models, 500K on Fable 5, Opus 4.6 to 4.8 and Sonnet 4.6, 200K on the rest |
| Gemini app without an AI plan | 32K |
| Gemini app with Google AI Plus | 128K |
| Gemini app with Google AI Pro or AI Ultra | 1M |
Anthropic's help center lists the 1M chat models as Fable 5.2 and 5.1, Opus 5.5 and 5, Sonnet 5.5 and 5, and Haiku 5.5. Its pricing page shows "up to 1M" on every plan, Free included, but notes that it varies by model, and the help article only spells out the paid plans.
The gap between ChatGPT and the API is the part that catches people out. GPT-6.2 takes over a million tokens through the API, but a ChatGPT Plus chat on the default Instant model gets 54K, which by OpenAI's rule of thumb is around 40,000 words. If you plan to paste in a whole book, your app and plan matter more than the model's headline number. Our ChatGPT vs Claude vs Gemini comparison covers the rest of what each plan includes.
How context windows got this big
Windows have grown more than a hundredfold in under four years.
| Date | Milestone |
|---|---|
| March 2023 | GPT-4 launches with 8,192 tokens, plus a limited 32,768-token version OpenAI put at about 50 pages |
| May 2023 | Anthropic expands Claude from 9K to 100K tokens, about 75,000 words |
| February 2024 | Google's Gemini 1.5 Pro arrives with 128K as standard and up to 1M in a private preview; Google said it had tested 10M in research |
| April 2025 | Meta announces Llama 4 Scout with what it called an industry-leading 10M-token window |
| August 2025 | Claude Sonnet 4 goes from 200K to 1M tokens in a public beta on the API, at a higher price above 200K |
| November 2026 | 1M is the standard window on the flagship models from Anthropic, OpenAI and Google |
Why don't AI models have unlimited context?
Compute and memory.
In a transformer, the design behind nearly every modern language model, each token can look at every other token. The 2017 paper that introduced transformers puts the cost of a self-attention layer at O(n² · d), where n is the sequence length, so doubling the input roughly quadruples that part of the work. Anthropic's engineers make the same point in plainer terms: n tokens create n² pairwise relationships, and at long lengths the model's attention gets stretched thin.
Memory is the other wall. While a model writes, it keeps a key-value (KV) cache of the tokens it has already processed so it doesn't have to recompute them. NVIDIA's guide to inference shows that cache growing in step with the length of the input: for the small Llama 2 7B model at 16-bit precision, a single 4,096-token sequence already needs about 2 GB. That's why long context is expensive to serve, and why model makers put so much work into shrinking it. DeepSeek, for example, says DeepSeek V4-Pro needs about 10% of the KV cache its earlier V3.2 model used at 1 million tokens.
Is a bigger context window always better?
No. A model that accepts a million tokens doesn't use all of them equally well. Anthropic's own docs say accuracy and recall degrade as the token count grows, which it calls context rot, and that what you put in the window matters as much as how big it is.
The research backs that up:
- Lost in the Middle (2023). A team led by Nelson F. Liu found that models did best when the useful information sat at the start or end of the input and noticeably worse when it was buried in the middle, even models built for long contexts.
- RULER (2024). NVIDIA researchers tested 17 long-context models on 13 tasks. All of them claimed 32K tokens or more, but only half performed satisfactorily at 32K. GPT-4-1106-preview, sold with 128K, reached an effective length of 64K by RULER's measure.
- Context Rot (July 2025). Chroma tested 18 models from Anthropic, OpenAI, Google and Alibaba and found they got less reliable as inputs grew, even on simple tasks. In one test, every model answered better from a focused prompt of about 300 tokens than from a full chat history of about 113,000 tokens containing the same answer. Distractors that looked like the answer made things worse.
- Google's own caveat. Google's long-context guide says Gemini does well at finding a single "needle" in a long input, but accuracy varies widely when it has to find several, and reliably pulling out 100 separate facts might take 100 separate requests.
The sources don't fully agree on the middle problem: in one of Chroma's 2025 needle-in-a-haystack tests, where the answer sat made no notable difference, which hints that newer models may handle position better than the 2023 crop did. That was a single task, though. The studies do agree that more input gives a model more chances to miss or mix something up.
In practice, a big window is excellent for one-off jobs such as summarizing a long report, comparing two contracts or tracing a bug through a codebase. It's a much worse place to keep a sprawling conversation that has drifted across five topics.
What happens when you hit the context window limit?
It depends on where you are.
In the API, the request fails or the reply stops short. Anthropic returns a "prompt is too long" error if the input alone is bigger than the window. If the input fits but the answer runs out of room, the reply stops with the stop reason model_context_window_exceeded. Google's API trims the maximum output to the space that's left.
In chat apps, it varies:
- Claude on paid plans summarizes earlier messages when a chat nears the limit, and your full history stays visible. Anthropic says code execution has to be switched on for this to work, and that long chats which trigger it use more of your usage allowance. Its API docs also note that chat apps can drop the oldest turns first.
- Gemini may give answers that don't account for everything once a chat or prompt is over the limit, Google says, and miss connections between details spread across large files.
- ChatGPT on the Free plan shows a notice such as "Context window full" or "You've reached the maximum length for this conversation," according to OpenAI's help center. Your options are a new chat, carrying on from a summary if the notice offers one, or branching from an earlier reply into a new chat. OpenAI doesn't say what happens to older messages before that point; AI Toolbox's guide to ChatGPT's limits reports that they can quietly fall out of what the model sees.
In coding agents, the usual fix is compaction: summarizing the conversation so far and carrying on from the summary. Claude Code compacts automatically as you approach the limit and then re-reads up to five of the files it touched most recently. Anthropic also offers server-side compaction in its API, in beta for Claude 4.6 and later, and OpenAI's Responses API has its own compaction option. Agents run long loops of tool calls that fill a window fast, which is why context management is such a big part of how they work.
Do bigger context windows cost more?
Yes, in two ways.
First, because the whole conversation is sent again on every turn, a long chat costs more per message than a short one. Google says long Gemini chats use more of your allowance because Gemini has to re-read the history, and Anthropic's help center says the same about long Claude conversations.
Second, some APIs charge more for long prompts:
- Anthropic bills Claude 4.6 and later models at one per-token rate across the full 1M window. Its pricing page says a 900K-token request costs the same per token as a 9K one. Claude Haiku 5.5 is the exception: once a prompt passes 100,000 tokens, input goes from $0.10 to $0.50 per million tokens and output from $0.50 to $2.50.
- OpenAI doubles GPT-6.2's input price for requests over 272K input tokens and charges 1.5 times the usual output rate on those requests. For GPT-6.2 Sol, input goes from $2 to $4 per million tokens and output from $10 to $15.
- Google lists a single price for each Gemini 4 model, with no separate tier for long prompts.
Prompt caching cuts the cost of content you send again and again, such as a long document you keep asking about. Anthropic points out that cached tokens still take up space in the window, though; caching changes the bill, not the limit.
How to get more out of a context window
- Start a new chat when you change topics. Google recommends it for Gemini, and Claude Code's docs give the same advice for its
/clearcommand: old conversation crowds out what you need now. - Include only what's relevant. Anthropic's guidance is to find the smallest set of high-signal tokens that does the job, and Google advises against sending tokens you don't need. Three relevant chapters beat a whole book.
- Put your question after the long material. Google's long-context guide recommends placing the query at the end of the prompt.
- Summarize before you run out. In Claude Code,
/compactwith instructions, such as/compact focus on the auth bug fix, keeps what you choose. In a chat app, ask for a summary of the decisions so far and paste it into a fresh chat. - See what's using the space. Claude Code's
/contextcommand shows a live breakdown by category. - Load things on demand for big collections. For a knowledge base far bigger than any window, retrieval tools search it and pass the model only the passages a question needs. Anthropic describes agents doing the same thing with files, keeping lightweight references such as file paths and opening content only when it's needed.
- Check your plan before loading something huge. The API figure doesn't apply to the chat app, and free plans get far less: Gemini gives 32K without a plan against 1M on AI Pro.
Frequently asked questions
What is a context window in simple terms?
It's how much an AI model can read and work with at once, measured in tokens. It covers your conversation, attached files, the app's instructions and the model's own reply, and anything beyond it is invisible to the model.
How many words is 1 million tokens?
Roughly 555,000 to 750,000 English words. Anthropic puts 1 million tokens at about 555,000 words on its current tokenizer and 750,000 on older ones, and OpenAI's three-quarters-of-a-word rule gives about 750,000.
Which AI chatbot has the biggest context window?
Among the three big apps, Claude's paid plans (on its newest models) and Gemini with Google AI Pro or AI Ultra offer 1 million tokens. On the plans OpenAI's pricing page lists, ChatGPT tops out at 400K, on Pro with a reasoning model.
Is the context window the same as memory?
No. The context window only holds the current request. Memory features, such as Claude Code's memory files, save notes elsewhere and load them back into the context window at the start of a session, so they still take up space.
Why does my AI chat get worse the longer it goes?
Models get less reliable as their input grows, a problem known as context rot, and long chats also tend to pile up off-topic material. Near the limit, apps drop or summarize older messages or ask you to start a new chat, so starting fresh with a short summary usually helps.
Does a bigger context window cost more?
Usually. The whole conversation is resent every turn, so long chats use more of your allowance, and some APIs charge more above a threshold, such as 272K input tokens for GPT-6.2 and 100,000 for Claude Haiku 5.5.
Sources
- Context windows, Claude API Docs
- Models overview, Claude API Docs
- Pricing, Claude API Docs
- How large is the context window on paid Claude plans?, Claude Help Center
- Plans and pricing, Claude
- Explore the context window, Claude Code Docs
- Effective context engineering for AI agents, Anthropic
- Introducing 100K context windows, Anthropic
- Claude Sonnet 4 now supports 1M tokens of context, Claude blog
- Anthropic's Claude AI model can now handle longer prompts, TechCrunch
- GPT-6.2 Sol, OpenAI API docs
- GPT-6.2 Astra, OpenAI API docs
- ChatGPT pricing, OpenAI
- Why does ChatGPT say "Context window full" or "Chat memory full"?, OpenAI Help Center
- ChatGPT context window and token limits by plan, AI Toolbox
- What are tokens and how to count them?, OpenAI Help Center
- Compaction, OpenAI API docs
- GPT-4, OpenAI
- Long context, Google AI Studio docs
- Long decode, Google AI Studio docs
- Gemini models, Google AI Studio docs
- Gemini 4 Carbon model page, Google AI Studio docs
- Gemini API pricing, Google AI Studio docs
- Gemini 4 Hydrogen model card, Google DeepMind
- Gemini Apps limits and upgrades for Google AI subscribers, Google Help
- Our next-generation model: Gemini 1.5, Google
- The Llama 4 herd, Meta AI
- Models and pricing, DeepSeek API Docs
- Change log, DeepSeek API Docs
- DeepSeek-V4-Pro, Hugging Face
- Context length, Ollama docs
- Mastering LLM techniques: inference optimization, NVIDIA Technical Blog
- Attention Is All You Need, arXiv- Lost in the Middle: How Language Models Use Long Contexts, arXiv
- RULER: What's the Real Context Size of Your Long-Context Language Models?, arXiv
- RULER, NVIDIA on GitHub
- Context Rot: How Increasing Input Tokens Impacts LLM Performance, Chroma
Was this helpful?
Thanks, noted. It helps decide what gets updated first.


