AI
What Is a Context Window? A Plain-English Guide
A context window is how much text an AI model can read at once. Learn how it works, why it fills up, and how to work within its limits.
A context window is the amount of text an AI model can see and work with at one time. It includes your message, the earlier conversation, any files you share, and the answer the model is writing. Anything outside the context window is invisible to the model in that moment. Once you understand this one limit, a lot of puzzling AI behavior starts to make sense, like why a long chat suddenly "forgets" something you said at the start.
This guide explains what a context window is, how it is measured, what happens when it fills up, and how to get better results without hitting its limits.
What Is a Context Window?
Think of a large language model as a reader with a desk. Whatever is on the desk, it can read, compare, and use. Whatever is not on the desk might as well not exist. The context window is the size of that desk.
If you are new to how these models work, our guide on what an LLM is covers the basics. The short version is that a model does not "remember" a conversation the way a person does. Each time it replies, it rereads everything in its context window and predicts what should come next.
That means the context window is the model's entire working view of your conversation. It is not a rough limit or a suggestion. It is a hard edge.
Why it is called a "window"
The word fits well. A window shows you part of a view at a time. A long document or chat can be much bigger than the window, and the model only sees the part that fits inside it.
Tokens: How a Context Window Is Measured
Context windows are measured in tokens, not words or pages. You will also see this called the context length or the token limit. In everyday use, all three terms mean roughly the same thing: the most text a model can handle at once.
What is a token?
A token is a small chunk of text. It might be a whole short word, part of a longer word, a number, or a punctuation mark. In English, a token is roughly three-quarters of a word on average, so 100 tokens is about 75 words. Other languages, and code, often use more tokens for the same amount of meaning.
You don't need to count tokens yourself. It just helps to know that the limit is measured in pieces of text, so long pasted documents use it up quickly.
What takes up space in the window
Many people assume only their latest message counts. In fact, the context window has to hold all of this at once:
- Instructions: Hidden setup text the app gives the model, plus any custom instructions you add.
- Conversation history: Every earlier message from you and the model in the current chat.
- Files and pasted text: Documents, spreadsheets, code, or web pages you share.
- Tool results: Search results or other data the model pulls in during the chat.
- The reply itself: The answer the model is writing also has to fit.
All of these share the same space. A long document leaves less room for conversation, and a long conversation leaves less room for documents.
Context window size varies a lot
Context window size differs from model to model. Some small models, especially ones built to run on personal computers, have fairly small windows. Large hosted models can often handle hundreds of pages of text in one go. These sizes have grown quickly over the past few years and keep changing, so check the current figure for whichever model you use.
What Happens When the Context Window Fills Up
Every long conversation eventually runs into the edge of the context window. Different apps handle this in different ways.
The oldest text drops out
The most common approach is to quietly drop the oldest parts of the conversation. New messages push old ones out of view. This is why a model may lose track of a detail you gave it near the start of a long chat. It hasn't forgotten in a human sense. That text is simply no longer on the desk.
The app summarizes for you
Some apps squeeze older parts of the chat into a short summary. That frees up space, but summaries lose detail. A specific number or name from early on may not survive.
You get an error or a cut-off answer
Sometimes the app refuses a request that is too long, or the model's reply stops partway through because it ran out of room. If you paste a very large file and get an error, the token limit is the likely cause.
Quality slips before the limit
Even before the window is full, very long inputs can make answers worse. Researchers have found that models often pay the most attention to the beginning and the end of long input, and less to the middle. This is sometimes called the "lost in the middle" problem. Long, messy context also makes it more likely the model will mix up details or make things up, a problem known as hallucination.
Context Window vs Memory
The context window vs memory question confuses many people, because chat apps now offer both.
The context window is short-term and exact. The model sees everything inside it word for word, but only for the current chat, and only as much as fits.
Memory features are long-term and selective. Some apps save short notes about you, such as your name, preferences, or ongoing projects, and carry them between chats. When you start a new chat, a few of those notes get placed into the context window so the model can use them.
So memory doesn't replace the context window. It feeds into it. The model still only works with what is on the desk. Memory just decides which few notes get put there at the start.
Does Context Window Size Matter?
Yes, but bigger is not automatically better. Here is how to think about it.
When a large context window helps
A big window is useful when you need the model to work with a lot of material at once:
- Reviewing a long contract, report, or book chapter
- Asking questions across many files in a codebase
- Long working sessions where you don't want to restart
- Comparing several documents side by side
When it matters less
For quick questions, short emails, or brainstorming, even a small context window is plenty. A model's reasoning quality, accuracy, and writing ability usually matter more than raw window size for everyday tasks.
The trade-offs of a bigger window
Filling a large window isn't free. More text means more processing, which usually makes responses slower. On paid APIs, you pay for the tokens you send, so stuffing in everything adds cost. And as noted above, the middle of a very long input may get less attention.
Running models on your own computer
If you run a model locally, context window size also depends on your hardware. Longer context needs more memory on your machine, so a laptop may only handle a fraction of what a model supports on paper. Our guide on how to run an LLM locally explains how to set this up and what to expect.
How to Work Within a Context Window
You can't make a model's window bigger, but you can use it more wisely. These habits help in any chat app.
Start a new chat for a new topic
Long chats fill the window with old, unrelated text. When you switch tasks, open a fresh chat. The model gets a clean desk and focuses on what matters now.
Put the important part first or last
Because models tend to focus on the start and end of long input, place your key instructions there. A good pattern is to state the task at the top, paste the material, then repeat the main question at the bottom.
Share only what is needed
Instead of pasting a whole 80-page report, paste the sections that matter. Less noise usually means better answers, and it leaves room for the conversation.
Ask for a summary before moving on
In a long session, ask the model to summarize the key decisions and facts so far. Then start a new chat and paste in that summary. You keep what matters and drop the rest.
Use retrieval for large collections
When you have far more material than any window can hold, such as a whole help center or years of documents, the usual answer is retrieval. A system searches your documents and places only the most relevant passages into the context window. This method is called retrieval-augmented generation, and our guide to what RAG is explains how it works.
FAQ
What is a context window in simple terms?
It is how much text an AI model can see at once. It holds your messages, the model's replies, any files you share, and its current answer. Anything that doesn't fit is invisible to the model.
How big is a context window?
It depends on the model. Small models made for personal computers often have modest windows, while large hosted models can take in hundreds of pages at once. Sizes change often as new models are released, so check the details for the model you use.
What is the difference between context window and token limit?
In everyday use, they mean the same thing. The context window is the space, and the token limit is its size, measured in tokens. Some providers also set a separate, smaller limit on how long a single reply can be.
Does a bigger context window mean a better model?
Not on its own. A bigger window lets a model handle more text at once, which helps with long documents. But reasoning, accuracy, and writing quality matter more for most tasks, and very long inputs can be slower and less precise.
Why does the AI forget what I said earlier in the chat?
The conversation has likely grown longer than the context window, so the oldest messages dropped out of view. Starting a new chat with a short summary of the key points usually fixes it.