Skip to content
Koit Academy
AI Guides·

8 min read

What Is a Context Window? AI Memory Limits Explained

A context window is how much text an AI model can handle at once. What it includes, how big it is in words and pages, and what to do when you hit it.

By Koit Academy

AI assistants seem to remember a conversation, read long documents and keep track of instructions. All of it happens inside one limit: the context window, the maximum amount of text a model can work with in a single request. When an assistant forgets the start of a long chat, refuses a file as too long or stops an answer halfway, the context window is usually the reason.

This post explains what the context window contains, how to convert its size into words and pages, and what to do when your material does not fit.

The window holds everything at once

A model does not keep a memory between requests in the way a person does. Every time it answers, it is given a single block of text and works from that alone. The context window is the maximum size of that block, measured in tokens, and everything has to fit inside it:

  • The system prompt: the standing instructions an app or a developer gives the model.
  • Your message, including anything you paste.
  • Attached files, once they have been turned into text.
  • The conversation so far, in a chat that carries earlier turns forward.
  • The answer the model is writing.

The last item catches people out. The reply counts towards the same limit, so input that fills the window leaves no room to answer.

Measured in tokens, not words

Tokens are the pieces of text a model reads and writes, often parts of words. Google’s documentation for its Gemini models puts a token at about 4 characters, and 100 tokens at about 60 to 80 English words. That gives a rough conversion for any window size:

WindowWords, roughlyPages of 500 words
8,000 tokens4,800 to 6,40010 to 13
32,000 tokens19,000 to 26,00038 to 51
128,000 tokens77,000 to 102,000154 to 205
200,000 tokens120,000 to 160,000240 to 320
1,000,000 tokens600,000 to 800,0001,200 to 1,600

These are totals for the whole window, before anything is kept for the answer or the instructions. For the room actually left for your material, the context window calculator subtracts both. With a 200,000-token window, 8,000 tokens kept for the answer and 2,000 for instructions, it leaves 190,000 tokens, about 133,000 words at 0.7 words a token.

Text that is not ordinary English uses tokens faster: code, tables, numbers and other languages usually take more tokens per word. For a specific document, the token counter gives an estimate from the text itself.

Why long chats forget

In a chat, each new message is sent together with the conversation before it, so the input grows with every turn. Eventually the conversation is longer than the window. Apps handle this in different ways: dropping the oldest messages, summarising them, or refusing to continue. Either way, details from early in the conversation are no longer in front of the model, which is why it seems to forget instructions you gave an hour ago.

Two habits help. Put standing instructions somewhere they are sent every time, such as an app’s custom instructions or a project’s settings, rather than only in the first message. And when a conversation has run long or changed topic, start a new one with a short summary of what matters.

Bigger is not automatically better

Windows have grown enormously, and very long inputs are now possible. Using all of that room is a different matter. Research by Liu and colleagues, published as “Lost in the Middle”, found that language models were often best at using relevant information placed at the beginning or end of a long input, and that performance dropped when the relevant part sat in the middle, even for models built for long contexts.

The practical lessons:

  • Put the most important instructions first or last, not buried between long documents.
  • Send what is relevant, not everything you have. A focused input often gives a better answer than a complete one.
  • Leave a margin below the limit for the answer and for safety.

Long inputs also cost more. Every token in the window is paid for as input on every request, which is why trimming what you send is one of the steps in how to reduce AI API costs.

When your material does not fit

There are three standard approaches, and they suit different jobs:

  1. Split it. Work through a long document in parts, one request per part, then combine the results. Good for summarising or checking a long report section by section.
  2. Summarise it first. Condense each part, then work from the summaries. Good when you need the overall picture rather than every detail.
  3. Retrieve only what is needed. Store the material in chunks and, for each question, find and send only the most relevant passages. This is retrieval-augmented generation, explained in what is retrieval-augmented generation, and it is how assistants answer questions over large libraries of documents.

For the third approach, the chunk size calculator works out how many chunks a document makes and how much retrieved text each question adds to the prompt.

A worked example: reviewing contracts

Suppose you want an assistant to review a 60-page contract. At about 500 words a page that is 30,000 words, or roughly 43,000 tokens at 0.7 words a token. A 128,000-token window holds it comfortably, with plenty of room for instructions and a detailed answer.

Now suppose you want to compare ten such contracts at once. That is about 430,000 tokens, which does not fit in a 200,000-token window at all. The options are the ones above: review each contract separately and then compare the summaries, or extract the clauses you care about, such as notice periods and payment terms, from each one and compare only those. Either way, the second approach is usually more accurate as well as possible, because each request is focused.

Chat apps and APIs

The same model can behave differently in a chat app and through an API. A chat app manages the conversation for you: it decides what to keep, may summarise older messages and may set its own limits on uploads. Through an API, nothing is kept between requests unless you send it, so you decide exactly what goes into the window each time, and you pay for exactly that.

Signs you are near the limit

A conversation or a request close to the context window tends to show it in recognisable ways:

  • The assistant stops following instructions you gave early on.
  • It asks for information you already provided.
  • An upload is refused or only partly read.
  • Answers stop before they are finished.

When that happens, the fix is rarely to repeat yourself in the same conversation. Start a new one, paste a short summary of what matters and only the material needed for the next step.

Output limits are separate

Alongside the context window, most models have a separate, smaller limit on how long one answer can be. A model with a very large window may still stop writing after a few thousand words. If you need a long document produced, ask for it in sections, one request each, rather than expecting a single answer to contain it all.

Checking a model’s window

Context windows change with every model release and sometimes differ between an API and a chat app built on the same model, or between subscription plans. The provider’s model documentation is the place to check the current figure. Once you have it, enter it in the calculator with the room you want to keep for the answer to see how much material fits.

Whichever approach you use, write down the window size and the margin you are keeping in your project notes, so that everyone working on the prompts plans against the same figure.

The short version

The context window is the model’s working space for one request, measured in tokens, and it holds the instructions, your input, the conversation so far and the answer together. Roughly, every 100 tokens is 60 to 80 English words. Leave room for the answer, put what matters most where the model is most likely to use it, and when the material is too large, split it, summarise it or retrieve only the parts you need. For how tokens themselves work, see what are tokens in AI.

Sources, read November 14, 2026: