Part of the AI visibility glossary
What is Context window?
A context window is the total amount of text a language model can work with in one request, measured in tokens. It holds the instructions, the conversation so far, any documents or search results added to the request, and the answer the model writes. Text that does not fit in the window is left out.
Also called: Context length, Context limit
What counts toward the window
Anthropic describes the context window as all the text a model can reference when it generates a response, including the response itself. It calls the window the model’s working memory, as distinct from the large body of data the model was trained on.
Anthropic’s documentation also lists what counts toward the window: the system prompt, every message, tool results, images, documents and tool definitions, plus the output the model writes. The size differs by model and is published by the model maker. OpenAI, for example, lists a context window of 400,000 tokens for GPT-5, an earlier model.
Why bigger is not always better
A larger window lets a model take in more text at once, but more text does not guarantee better answers. Anthropic notes that as the token count grows, accuracy and recall degrade, and calls this context rot.
Position matters too. A 2023 research paper, "Lost in the Middle: How Language Models Use Long Contexts", found that models often did well when the relevant information sat at the beginning or end of a long input, and noticeably worse when it sat in the middle.
When an AI assistant searches the web, the pages it fetches share the window with the question, its instructions and the other results. A page that states its key facts early and plainly gives the model less to sift through. Treat this as a sensible habit rather than a guarantee, because how much of a fetched page reaches the model depends on the product.
How to check it yourself
- Pick an important page, such as a product or service page, and copy its main text.
- Paste it into a tokenizer tool from a model maker to see roughly how many tokens it uses.
- Note where your key facts sit on the page: in the first paragraph, in the middle or near the end.
- Ask an AI assistant that cites sources a question the page answers, and check whether the answer uses the facts near the top and misses the ones further down.
- Where key facts sit deep in a long page, add a short summary of them near the top.
How this page was made
AI agents drafted this entry from the public sources listed below, and automated checks ran on it before it was published. Read our editorial policy.
Questions
Is a bigger context window always better?
Not on its own. A larger window lets a model take in more text at once, but model makers note that accuracy can drop as the input grows. What sits in the window, and where, matters as much as its size.
Is the context window the same as what a model knows?
No. The window is the text the model works with in a single request. What the model learned in training is separate, and it is limited by the model’s knowledge cutoff, not by the size of its window.
How is a context window measured?
In tokens, the small pieces of text a model reads and writes. A token is often only part of a word, so a window holds fewer words than its token count suggests.
Sources
- Context windows · Anthropic
- Context windows · Anthropic
- GPT-5 model · OpenAI
- Lost in the Middle: How Language Models Use Long Contexts · arXiv