LLM Context Window Explained: Tokens, Limits and What Happens When You Overflow

An LLM context window is the total text a model can hold in one request, in tokens. How big today's windows are, what happens on overflow, and how to cope.

By Galactic News Editorial · Published 2026-11-16T16:42:43+00:00 · Updated 2026-11-16T16:42:43+00:00

LLM context window explained with token limits and overflow behavior

LLM Context Windows Explained: Tokens, Limits and What Happens When You Overflow

An LLM context window explained simply is this: it is the total amount of text a language model can hold in view at once, measured in tokens. Everything in a request shares that one budget: the system instructions, the conversation history, any documents you attach, tool results, and the model's own reply. When the window fills up, the model cannot see more. It does not remember what fell out. Understanding that budget is the difference between a workflow that works and one that silently loses the middle of your document. Think of the LLM context window explained here as a desk: everything you need must fit on it at once, and the model's reply takes up space too.

LLM Context Window Explained: What Counts Toward the Budget

A token is the unit the model counts in, not a word. In English, one token averages about three to four characters, or roughly three-quarters of a word. A 1,000-word page is about 1,300 tokens. A 100,000-token document is roughly a short book. The window is a shared budget for input and output, not an input allowance alone. If a model has a 200,000-token window and you ask for 16,000 tokens of output, your real input budget is about 184,000 tokens, not 200,000. Always reserve room for the answer, or the model will run out of space mid-reply.

Two things surprise developers most. First, the window is per request, not memory. A model has no memory between separate API calls. Each call starts fresh, and only what you send in that call is visible. Second, a bigger window does not mean better answers. Accuracy and recall degrade as a prompt fills more of the window, a pattern Anthropic calls context rot. Information placed in the middle of a very long context is measurably harder for the model to recall than information at the start or the end.

How Big Are Today's Context Windows?

Model familyFlagship modelContext windowMax output
OpenAI GPTGPT-5 (API model)400,000 tokens128,000 tokens
Anthropic ClaudeOpus 5.5, Sonnet 5.5, Haiku 5.5, Fable 5.21,000,000 tokens128,000 tokens
Anthropic Claude (legacy)Haiku 4.5200,000 tokens64,000 tokens
Google GeminiGemini 4 ArgonAbout 1,048,576 tokensVaries by model

These are the numbers behind any LLM context window explained in 2026: API-level maximums from each provider's own documentation, checked in November 2026. The product you use may apply a smaller limit. OpenAI's GPT-5 Chat model, for example, is listed with a 128,000-token window, not the 400,000 of the API model. Chat apps, coding tools, and agent frameworks often set their own defaults well below the model maximum. Check the limit shown in the product, not just the model page.

What Happens When You Overflow

Overflow looks different depending on where it happens. On an API call, a request whose input alone exceeds the window is rejected with an error, typically a 400 response saying the context limit was exceeded. Nothing is silently truncated: the model either processes the full input or returns an error. On newer Claude models, a request whose input plus requested output exceeds the window is accepted, and generation stops with a reason of model context window exceeded. In chat products, the input locks and you see a warning that the conversation is too long. In coding tools such as Claude Code, the conversation is compacted automatically: earlier turns are summarized so the session can continue, which preserves the gist but loses detail.

That is the overflow behavior every LLM context window explained guide should cover, because it is silent. The quieter failure is not an error at all. A request that fits inside the window can still lose information, because the model recalls the edges of a long context better than the middle. If your key fact sits at token 500,000 of a million-token prompt, the model may miss it or misremember it. That is why stuffing everything into one giant prompt is a poor strategy even when it fits. A smaller, curated context usually beats a bigger, messier one.

How to Work Inside the Limit

  1. Count tokens before you send. The Anthropic SDK has a count_tokens method, and most providers offer a token counter. Measure the real request, including the system prompt and history, not just the new message.
  2. Reserve room for the answer. Subtract your expected output from the window before you size the input.
  3. Put the most important material at the start or the end of the prompt, not buried in the middle.
  4. Summarize instead of stacking. When a conversation grows long, replace old turns with a short summary of decisions and open items.
  5. Retrieve instead of stuffing. For large document sets, use retrieval to send only the passages relevant to the question, rather than the whole corpus.
  6. Split long jobs into stages. Summarize each document separately, then reason over the summaries.
  7. Watch the cost. A 200,000-token request costs roughly 200 times a 1,000-token request on input pricing, so a smaller context is cheaper as well as more reliable.

Bottom Line

A context window is a working budget, not storage. The LLM context window explained in one line: know the limit for the exact model and product you use, count tokens before you send, leave room for the output, and keep the important facts where the model can find them. When the job outgrows one window, summarize or retrieve rather than stuffing. The models with million-token windows are real, but the best results still come from the smallest context that holds everything the task needs.