Context Window Visualiser
Enter any limits you like and see the system prompt, tools, documents, history and output reservation drawn to scale.
17.9% of the window is committed once the output reservation is counted.
- System prompt
- 600 tokens · 0.47%
- Tool schemas
- 900 tokens · 0.70%
- Retrieved documents
- 12,000 tokens · 9.4%
- Conversation history
- 5,000 tokens · 3.9%
- Current user message
- 400 tokens · 0.31%
- Input total
- 18,900 tokens · 14.8%
- Reserved for output
- 4,000 tokens · 3.1%
- Committed
- 22,900 tokens · 17.9%
- Free
- 105,100 tokens
max_tokens is added. Fitting is also not the same as working — retrieval accuracy tends to fall well before the advertised limit, and it falls hardest for material in the middle.Or take the SVG source directly
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 720 132" width="720" height="132" role="img" aria-label="Context window usage"><text x="20" y="24" font-family="system-ui, sans-serif" font-size="13" font-weight="600" fill="#0b0b0b">Context window · 22,900 of 128,000 tokens committed</text><rect x="20" y="44" width="680" height="34" rx="6" fill="#f1f1ef"/><rect x="20.0" y="44" width="3.2" height="34" fill="#2a78d6"><title>System prompt: 600 tokens</title></rect><rect x="23.2" y="44" width="4.8" height="34" fill="#e26432"><title>Tool schemas: 900 tokens</title></rect><rect x="28.0" y="44" width="63.8" height="34" fill="#189e6e"><title>Retrieved documents: 12000 tokens</title></rect><rect x="91.7" y="44" width="26.6" height="34" fill="#bb7f00"><title>Conversation history: 5000 tokens</title></rect><rect x="118.3" y="44" width="2.1" height="34" fill="#cc6c90"><title>Current user message: 400 tokens</title></rect><rect x="120.4" y="44" width="21.3" height="34" fill="#8d8b85" opacity="0.55"><title>Reserved for output: 4000 tokens</title></rect><line x1="700.0" y1="36" x2="700.0" y2="86" stroke="#0b0b0b" stroke-width="1.5"/><text x="696.0" y="32" font-family="system-ui, sans-serif" font-size="11" fill="#52514e" text-anchor="end">limit 128,000</text><rect x="20" y="98" width="9" height="9" fill="#2a78d6"/><text x="33" y="107" font-family="system-ui, sans-serif" font-size="10.5" fill="#52514e">System prompt 600</text><rect x="158" y="98" width="9" height="9" fill="#e26432"/><text x="171" y="107" font-family="system-ui, sans-serif" font-size="10.5" fill="#52514e">Tool schemas 900</text><rect x="296" y="98" width="9" height="9" fill="#189e6e"/><text x="309" y="107" font-family="system-ui, sans-serif" font-size="10.5" fill="#52514e">Retrieved documents 12,000</text><rect x="434" y="98" width="9" height="9" fill="#bb7f00"/><text x="447" y="107" font-family="system-ui, sans-serif" font-size="10.5" fill="#52514e">Conversation history 5,000</text><rect x="572" y="98" width="9" height="9" fill="#cc6c90"/><text x="585" y="107" font-family="system-ui, sans-serif" font-size="10.5" fill="#52514e">Current user message 400</text></svg>
The window is smaller than the number on the box
A context limit is usually quoted as one figure, and people plan against it as though the whole thing were available for their prompt. Three deductions come off it before anything of yours goes in. The reply has to fit in the same window, so whatever you set max_tokens to is gone before you start. The system prompt and the tool schemas are there on every call whether or not this particular request needs them. And on a multi-turn conversation the history grows monotonically, so the room left for retrieved documents shrinks as the conversation goes on — which is why long chats start silently returning worse answers rather than errors.
Drawing it to scale makes one thing obvious that a list of numbers hides: which segment is actually large. In most real setups it is the retrieved documents, by an order of magnitude, and the system prompt that everyone spends the afternoon trimming is a sliver. If the bar says that, trim retrieval — fewer chunks, or smaller ones — before you touch anything else.
Two limits on what this can tell you. Fitting is a necessary condition, not a sufficient one: models retrieve less reliably from the middle of a long context than from either end, so a request that fits at 95% of the window can still answer worse than the same request at 40%. And the numbers here are whatever you entered — count them with a token counter or, better, read them off usage on a real response, because the wrapping a provider adds around messages and tools is not something you can see from your own side of the request.