Preferences

Privacy is important to us, so you have the option of disabling certain types of storage that may not be necessary for the basic functioning of the website. Blocking categories may impact your experience on the website. More information (Cookie Policy)

Context Window: How Much an AI Model Can Read at Once in 2027

A context window is the maximum text, in tokens, an AI model can use at once. Learn how it works, its limits and why it matters for AI search.

Sorank customerSorank customerThomas Girauc, Sorank customerCelio Fabiano, Sorank customerSorank customerXavier Breull, Sorank customer
+ 9'000 Subscribers
Context Window: How Much an AI Model Can Read at Once in 2027
Notification: your site reached 20K clicks from Google Search in 28 days

Tools

On this page

Summary

A context window is the maximum amount of text, measured in tokens, that a language model can use in one request. It includes the instructions, the conversation history, any retrieved documents and the reply itself, so anything beyond the limit is dropped or summarized.

Want to go further? Ask

Context window is the working memory of a large language model (LLM). Everything the model reads or writes for one response has to fit inside it, and information outside the window is invisible to the model for that request.

What is a context window?

A context window is the complete set of text a model can refer to when it generates a response, including the response itself. Anthropic's context window documentation describes it as a working memory for the model, which is different from the large body of data the model learned during training. Everything in the window counts: the system instructions, the user message, earlier turns, retrieved passages and the answer being written.

How does a context window fill up across turns?

Each turn adds to the window, so the input keeps growing as a conversation continues. In Anthropic's illustration, every user message and every response stays in the input of the next turn, which is why a long chat reaches the limit sooner than a short one. Chat interfaces can also drop the oldest messages first, on a rolling first in, first out basis, which is why an assistant can seem to forget the start of a long discussion.

Diagram from Anthropic's documentation showing how each user message and each response accumulates in the input across three turns, inside a context window of up to 1M tokens
The context window diagram in Anthropic's documentation shows how each turn adds to the input (screenshot of docs.claude.com).

The diagram shows the principle clearly: the input of turn three contains everything from turns one and two, and the total must stay within the window's budget. Once that budget is used up, something has to give, either older messages are removed or they are compressed into a summary.

What are tokens, and how do they count against the window?

The window is measured in tokens, not in words or characters. A token is a unit of text produced by the model's tokenizer, and it can be a whole word, a fragment of a longer word or a punctuation mark. The number of tokens depends on the tokenizer and on the language, so the same paragraph often takes a different number of tokens in English than in another language.

This matters in practice because long documents, code and pasted logs fill the window faster than their word count suggests. A short question with a long attachment can use most of the budget before the model has started to answer.

What window sizes do AI models offer?

Window sizes are advertised maximums, and they have grown quickly. The table below summarizes what two major providers state in their documentation at the time of writing.

Model familyStated context windowWhere it is stated
Claude (Anthropic)Up to 1M tokens, depending on the modelAnthropic context window documentation
Gemini (Google)1M tokens or more for many modelsGemini API long context documentation

Google's long context documentation for Gemini explains that many Gemini models come with a window of one million tokens or more, which lets developers send whole codebases or long transcripts in one request. Other providers and open models offer different sizes, so check the documentation of the exact model you use before you design a workflow around its limit.

Does a bigger context window mean better answers?

Not automatically. A larger window lets you fit more text, but the model does not use all of that text equally well. In a 2023 paper, Liu and colleagues found that performance is often highest when the relevant information sits at the beginning or the end of the input, and that it degrades significantly when the same information sits in the middle of a long context, even for models built for long contexts. Researchers call this the lost-in-the-middle effect.

Anthropic's documentation makes the same point in practical terms: as token count grows, accuracy and recall degrade, a phenomenon it calls context rot. The lesson is to curate what enters the window, not to fill it because it is available.

How do developers manage a context window that is nearly full?

Most production systems do not rely on a large window alone. Retrieval augmented generation fetches only the passages that match the question and places them in the prompt, which keeps the window small and focused. Other methods include summarizing older turns, trimming long tool outputs and keeping standing instructions short. Anthropic describes server-side compaction, which summarizes earlier parts of a conversation, as the primary strategy for long-running and agentic workflows.

Common context window mistakes

  • Treating the advertised maximum as the usable size: the model may handle a short window well and a near-full one poorly.
  • Pasting whole documents: when only one section answers the question, the rest spends budget and adds noise.
  • Burying the key instruction in the middle: put the critical rule at the start or the end of the prompt, where models attend most reliably.
  • Forgetting the reply: the answer counts toward the window, so a very long response leaves less room for the question.
  • Assuming the model remembers everything: messages that have left the window are not available to the model unless they were kept or summarized.

Why does context window matter for SEO and GEO?

For SEO and generative engine optimization, the context window is the space your content competes for inside an AI answer. When an assistant retrieves sources, only part of each page fits into its window, so a passage that answers the question in its first sentences is more likely to be used than a page padded with filler. This is the logic behind content chunking: self-contained sections that a retrieval system can lift out whole and place in a limited budget.

Writing for this constraint means putting the answer first, keeping each section focused and removing text that adds no information, the same habits described in LLM ready content. To check how easily an assistant can extract answers from one of your pages, try Sorank's free LLM readability checker. For a broader view of becoming a source that AI assistants cite, read our guide to getting cited by AI assistants.

Conclusion

A context window is the working memory of a language model, the total text, measured in tokens, that it can use to write one reply. It is bounded, and it is imperfect: accuracy degrades as the window fills, and information in the middle of a long input is easily missed. Write compact, answer-first passages that remain useful when a retrieval system pulls them into a limited window, and your content has the best chance of being read and cited.

Sources

Frequently asked questions

What is a context window in an LLM?

It is the maximum amount of text, measured in tokens, that a model can use in one request. It includes the instructions, the conversation history, retrieved documents and the reply itself.

Does a bigger context window always give better answers?

No. A larger window lets you fit more text, but models do not use all of it equally well. Information placed in the middle of a long input is often missed, so what you put in front of the model matters more than its size.

Why does the context window matter for AI search visibility?

When an assistant answers a question, only part of each retrieved source fits in its window. Concise, well-structured passages that answer the question directly are more likely to be used and cited than padded text.

Our Blog for Ambitious Company

Testimonials from ambitious founders

0 to 10000 visitors in 5 months

Celio Fabianomonrobotlavevitre.frGoogleE-commerce

0 to 5000 visits in 8 months

Thibault BMsorank.comGoogleSoftware

0 to 1104 clicks in 4 months

Dominiqueflight-sensations-idf.comGoogleLeisure and aviation

0 to 163 clicks in 6 months

Coworking Pariscoworking-paris.frGoogleOffice broker

x92 clicks in 7 months

Guide Zanzibarguidezanzibar.comGoogleTravel