Models

Context Windows Explained: What Long Context Really Means

Context windows in plain English: tokens vs. words, the real limits of GPT-6, Claude and Gemini, and how to tell if your file fits or needs RAG.

A context window is the total amount of text an AI model can work with in a single request: your instructions, any files you attach, the conversation so far, and the answer it writes back. It is measured in tokens, not words or pages. In November 2026 the flagship models from OpenAI, Anthropic and Google all list windows of about one million tokens, roughly 750,000 English words. That doesn’t end the problem. Models still miss details buried in the middle of long inputs, huge prompts cost money on every request, and a file that “fits” can still get a worse answer than a short, focused one.

Below: what the window really holds, the current limits from vendor docs, and how to tell whether a 120-page lease, a year of Slack messages or a codebase will fit.

What a context window actually is

Think of it as the model’s desk: everything it can see while answering has to be on the desk at once. Anthropic’s documentation describes it as “all the text a language model can reference when generating a response, including the response itself,” and calls it a working memory, separate from the huge body of data the model was trained on.

Three things people often get wrong:

  • The answer shares the space. On Google’s Gemini 4 models, the one-million-token window is shared across input, thinking and output. On Claude, extended thinking tokens count toward the window too. A full desk leaves no room to write.
  • Everything in the request counts. System instructions, tool definitions, earlier chat turns, images and attached documents all use tokens, not just the question you typed.
  • The model doesn’t remember between requests. A chat app resends the conversation each turn and trims it when it gets long. Anthropic notes that apps such as claude.ai can manage the window on a rolling “first in, first out” basis, which is why long chats forget their beginnings.

Tokens vs. words vs. pages

A token is a chunk of text: a word, part of a word, or punctuation. OpenAI’s help center gives these rough estimates for English: one token is about four characters, about three-quarters of a word, and 100 tokens are about 75 words. Google’s Gemini docs give a similar figure: 100 tokens equal about 60 to 80 English words.

So a simple conversion for English prose is:

  • Tokens ≈ words × 1.33 (or characters ÷ 4)
  • 1 million tokens ≈ 750,000 words

Pages vary too much for a fixed rule. A double-spaced page might hold 250 words; a dense legal page, twice that. We plan with about 500 words (roughly 670 tokens) per dense page. That’s our assumption, not a vendor figure, so count your own document when it matters.

Four things push token counts higher than you’d expect:

  • The tokenizer. Anthropic says Claude Opus 4.7 and later models use a tokenizer that produces roughly 30 percent more tokens for the same text than earlier Claude models. Counts don’t transfer between models.
  • File format. Anthropic estimates each PDF page sent to Claude typically uses 1,500 to 3,000 text tokens, and each page is also processed as an image.
  • Markup. JSON, spreadsheets, HTML and code carry brackets, field names and IDs that all count.
  • Language. OpenAI notes that other languages can have a different relationship between characters, words and tokens than English does.

Current context limits of major models (November 2026)

From each vendor’s official documentation, checked November 16, 2026. These change often, so recheck the linked pages.

Model family Context window Max output Fine print worth knowing
OpenAI GPT-6 Astra, GPT-6.1 Sol, GPT-6.1 Terra, GPT-6 Luna 1,050,000 tokens 128,000 tokens Maximum input is 922,000 tokens. API prompts over 272,000 input tokens are billed at 2x input and cache rates and 1.5x output for the whole request. GPT-6.1 Sol defaults to a 500,000-token window in Codex and ChatGPT Work.
Anthropic Claude Fable 5.2, Opus 5.5, Sonnet 5.5, Haiku 5.5 1,000,000 tokens 128,000 tokens 1M is the default with no beta header. Long prompts are billed at standard rates, except Haiku 5.5, where prompts over 100,000 tokens cost more. Up to 600 images or PDF pages per request.
Google Gemini 4 Carbon, Argon, Hydrogen 1,048,576 tokens 65,536 by default; up to 1,048,576 with long decode The window is shared by input, thinking and output. If input plus your output limit exceeds the window, the API caps the output to the space left.
Alibaba Qwen4-Max 1M tokens 393K tokens QwenCloud lists a maximum input of 991K tokens.

At the top end, window size no longer separates these models much, and the number on the model card isn’t always what you get in an app or coding tool, as the Sol example shows. Treat it as one line on your checklist. Our guide to choosing an AI model covers the rest.

Where long context breaks down

Information in the middle gets missed

The best-known study here is “Lost in the Middle” by Nelson F. Liu and colleagues, published in Transactions of the Association for Computational Linguistics. They found that 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 models tested were older than today’s, but vendor advice still reflects the lesson: placement matters.

Needle-in-a-haystack scores flatter real work

Vendors often show near-perfect “needle in a haystack” results, where the model finds one planted sentence in a long document. Cheng-Ping Hsieh and colleagues built a harder benchmark called RULER and found that “despite achieving nearly perfect accuracy in the vanilla NIAH test, almost all models exhibit large performance drops as the context length increases.” Of 17 models that claimed windows of 32,000 tokens or more, only half held up at 32,000.

Google’s Gemini docs agree: needle tests use one needle, and with several pieces of information, “the model does not perform with the same accuracy.” Real tasks, like comparing every renewal clause in a lease, usually mean finding and combining many needles.

More text can mean worse answers

In a 2025 technical report, Chroma tested 18 models on questions about long chat histories. Each question was asked two ways: with the full history, averaging about 113,000 tokens, and with only the relevant parts, about 300 tokens. Every model did significantly better on the focused version. Anthropic’s docs now name the effect directly: “As token count grows, accuracy and recall degrade, a phenomenon known as context rot.” Irrelevant text is a distraction, not a free extra.

Cost and latency add up

You pay for every input token on every request. Input cost alone for one question that sends 900,000 tokens, at list prices:

  • GPT-6.1 Sol: $2 per million input tokens, doubled above 272,000 tokens, so about $3.60.
  • Claude Opus 5.5: $4 per million, so about $3.60. Claude Sonnet 5.5 at $2 per million is about $1.80.
  • Gemini 4 Carbon: $2 per million through November 30, 2026, so about $1.80, rising to $4 per million (about $3.60) from December 1.

Fifty such questions would cost $90 to $180 in input before caching. Speed suffers too: Google’s FAQ says longer queries generally take longer to return the first token.

Prompt caching helps, with conditions

Prompt caching stores the processed start of a prompt so later requests that begin with identical content are cheaper and faster. OpenAI says cached reads on GPT-6.1 Sol and Terra cost 5 percent of the normal input rate. Anthropic’s standard cache-read rate is 10 percent of base input, falling to 5 percent on Opus 5.5 and Sonnet 5.5 and 2.5 percent on Fable 5.2. Google’s implicit caching is on by default for Gemini 2.5 and newer.

The catch: the cached part must be an identical prefix, so put the big unchanging document first and the question last. Caches expire (Anthropic’s default is five minutes, refreshed on each use; OpenAI’s is 30 minutes), and cache writes cost 1.25x normal input on both. Caching makes repeat questions affordable. It does nothing for accuracy.

How to tell if your file fits: a step-by-step checklist

  1. Get a raw count. In Word or Google Docs, use the word count tool. For a folder of text files, a command like wc -w works. For code, count characters.
  2. Convert to tokens. Multiply words by 1.33, or divide characters by 4.
  3. Add a buffer. Add 25 to 30 percent for PDFs, tables, JSON, code, non-English text or newer Claude models. That’s our rule of thumb, not a vendor number.
  4. Reserve room for the answer. Leave space for instructions, output and thinking. OpenAI caps input at 922,000 tokens.
  5. Check the price lines. Note whether you cross 272,000 input tokens on OpenAI or 100,000 on Claude Haiku 5.5, where pricing changes.
  6. Get an exact count before you commit. OpenAI’s input-token counting endpoint and Anthropic’s token counting API are both free to use, and Gemini has a countTokens method. Count with the exact model you plan to use.
  7. Decide: send it all, or narrow it. Use the table in the next section.
  8. If you send it all, structure it. Put documents first and your question last. Anthropic says queries at the end “can improve response quality by up to 30 percent in tests,” and Google gives the same advice. Label each document with a tag or heading. Our prompt-writing guide covers this in detail.
  9. Ask for evidence. Have the model quote the section number or passage behind each claim, then spot-check a few. This catches the confident made-up answers covered in why AI makes things up.
  10. Test with known answers. Ask three or four questions you can already answer, including one from the middle of the document.

When to stuff it all in, and when not to

Situation Best approach
One document, comfortably inside the window, a handful of questions Send the whole thing. Put the question last and ask for citations.
Same large document, many questions over a day Send it whole and keep it at the start of every prompt so caching applies.
Far bigger than the window, or a big pile where only small parts matter Retrieval (RAG): search the collection and send only the relevant passages.
You need the big picture of something too large to fit Chunk and summarize: summarize each part, then summarize the summaries.
Answers must be exact and complete, like every date or dollar figure Extract into a table one section at a time, then analyze the table.

Our RAG vs. fine-tuning guide explains how retrieval works and when it’s worth building.

Three worked examples

Illustrative examples. The businesses and figures below are made up to show the math. The per-token prices and limits are from vendor docs.

A 120-page commercial lease

A bakery owner in Chicago wants to understand her new retail lease before signing. At about 500 words per dense page, 120 pages is roughly 60,000 words, or about 80,000 tokens as plain text. That fits every model above and stays under OpenAI’s 272,000-token surcharge line. At $2 per million input tokens, each question costs about 16 cents in input.

The format catch: sent as a PDF to Claude, Anthropic’s 1,500 to 3,000 tokens per page puts the same lease at 180,000 to 360,000 tokens, plus image costs, so plain text is cheaper if she only needs the words. Her setup: the full lease first, then targeted questions like “List every fee besides base rent, with the section number for each.” She checks the cited sections and has a lawyer review anything she signs.

A year of Slack exports

A 25-person Denver marketing agency wants to know why a client project slipped. Say the team sent 150,000 messages in a year, averaging 20 words each. That’s about 3 million words, or roughly 4 million tokens, before counting the user IDs, timestamps and JSON fields in a Slack export. It doesn’t fit any window listed above.

Filter first, to the two project channels and the six months that matter. If that’s still too big, use retrieval, or summarize month by month and question the summaries. Check your company’s AI policy before uploading chat logs. Our guide on using AI at work without leaking data covers what to strip out.

A company codebase

Google’s docs say one million tokens is about 50,000 lines of code at 80 characters per line. A small 20,000-line internal tool at that density would be roughly 400,000 tokens. It fits, but it’s over OpenAI’s surcharge line and uses a large share of the window. A 200,000-line product codebase would be around 4 million tokens, far beyond any window.

That’s why coding agents search and read only the files they need. For a large codebase, point the tool at the relevant folders, add a short architecture note, and let it pull in files as it works.

The short version

A context window is the model’s working space, measured in tokens, about 1.33 per English word. Flagship models now offer around a million, but a bigger window isn’t better reading. Estimate, confirm with the vendor’s free counter, and send only what the task needs. Documents first, question last, citations always, caching for repeats. When the material dwarfs the window or only a slice matters, retrieval or summarizing usually wins.

Sources

Figures are from vendor documentation as of November 16, 2026, and change often. This article is general information, not legal or financial advice.

Kabeer Ahmed

Kabeer Ahmed is the founder and editor of The AI Year, where he explains AI tools, models, agents and AI security in plain English. He works on AI automations for businesses and is the founder of Runnex Logistics and of Aurel Digitals, a web design and automation agency. He writes practical guides for people using AI at work, covers selected news with links to primary sources, and reviews every post before it's published. Reach him at hello@theaiyear.com or on LinkedIn: https://www.linkedin.com/in/kabeerahmed09

Keep reading

Models

Gemini 4 Carbon vs Mistral Large 4: Which to Use

Google's Gemini 4 Carbon just took #1 on the Artificial Analysis Intelligence Index, but only cyber defenders and trusted partners can use it. Mistral Large 4 is open weight and available today. Here's what each offers, what it costs, and how to choose.

·6 min read