Context Window Visualizer
See how much of an LLM context window your system prompt, history, RAG context and response use. Type token counts or paste text. Free.
This model has no public tokenizer; pasted text is counted with OpenAI’s o200k_base as an estimate.
Your input stays in your browser — nothing is uploaded to our servers.
Every request to a language model has to fit in its context window. In a real app that window is shared by several things at once: the system prompt, the conversation so far, documents pulled in by search (RAG), the new user message and the space you leave for the answer. This visualizer shows how much each part takes, so you can see what to trim before a request fails or gets expensive.
How to use the context window visualizer
- Choose a model. Its context window is shown next to its name, using the provider’s official figure.
- For each part of the request, type a token count, or switch to Paste text and paste the real content to have it counted.
- Read the bar: each colour is one part, and the summary shows tokens used, the percentage of the window and how many tokens are left.
- If the request overflows, the tool tells you by how much. Shorten the largest parts first.
What is a context window?
The context window is the maximum number of tokens a model can work with in one request. For most chat APIs it covers input and output together: if the window is 200,000 tokens and you send 190,000, the model has at most 10,000 left to answer, and your max_tokens setting can’t raise that.
In a chat app, history is the part that quietly grows: every turn resends all earlier messages. RAG context can also be large, because retrieved chunks are pasted into the prompt in full. The system prompt is usually small, but it is sent with every single request.
When a request doesn’t fit, the API returns an error or the app has to drop something. Common fixes are summarising or truncating old turns, retrieving fewer or shorter chunks, and capping the response length. Even when everything fits, a fuller window means a higher bill and slower responses, and models may pay less attention to details buried deep in very long inputs.
Frequently asked questions
Does the response count towards the context window?
For most chat and messages APIs, yes: input and generated output share the same window. That’s why the visualizer has a “reserved for the response” part. Some providers also list a separate maximum output length, which can be smaller than what’s left in the window.
Why do the counts for pasted text show “≈” for some models?
Only OpenAI publishes the tokenizers of its current models. For other models the pasted text is counted with OpenAI’s o200k_base tokenizer as an estimate, so the real number can differ, especially for non-English text and code.
What happens when I exceed the context window?
The API usually rejects the request with an error. Some chat apps silently drop the oldest messages instead, which can make the model “forget” earlier instructions. Trimming history and retrieved context on purpose gives you control over what is lost.
Why does the bar sometimes show 1M and sometimes 1.05M?
Providers define their windows differently: some use exactly 1,000,000 tokens, some 1,048,576 (2²⁰), and some other figures. The tool uses each provider’s own published number.
Is the text I paste sent anywhere?
No. Counting happens in your browser. The tokenizer vocabulary is downloaded from this site once; your text stays on your device.