What is a context window?
A context window is the maximum amount of text, measured in tokens, that a language model can take in and consider at one time. It includes your prompt, any documents or conversation history, and the model's own reply.
Last reviewed .
What the context window limits
Everything the model needs for a task must fit in the window. If a document or conversation is longer than the limit, part of it has to be cut, summarized, or left out.
Window sizes vary by model and change as models improve, so check the documentation for the one you use.
Working within the limit
For long material, you can summarize earlier sections, split the work into parts, or retrieve only the relevant passages with retrieval-augmented generation. Keeping prompts focused also helps.
A larger window doesn't guarantee the model will use every detail equally well, so test it on your own material.
Context window and cost
Many AI services price usage by tokens, so sending more text can cost more and take longer. Sending only what the task needs saves both.
Common questions
How is a context window measured?
It's measured in tokens, which are small pieces of text such as words or parts of words. The limit covers both your input and the model's output.
What happens when you exceed the context window?
Depending on the tool, the request may fail, or older content may be dropped or truncated. The model can't use text that doesn't fit.
Is a bigger context window always better?
Not always. A larger window lets you include more material, but it can raise cost and response time, and the model may not weigh all of it equally.
Is a context window the same as memory?
Not exactly. The window holds what the model can see right now. Many tools add separate memory features that save information between sessions and feed it back in.
Want help putting this to work?
Tell us where your marketing stands today, and we'll show you what to do first.