DevTools Logo

Context Window Fill Visualizer

Context Window Fill Visualizer

See how system prompts, history, documents and reply reserves fill a model's context window.

Runs in your browser
Try an example

Model and content

GPT-4o · 128,000 tokens · ≈ o200k heuristic

Shared input+output window; reserve reply tokens.. Counts are heuristic (≈), not exact tokenizer output; no encoder is downloaded.

Context fill

≈2,813 of 128,000 tokens

GPT-4o · 128,000 tokens

  • System reserve: ≈512 (0.4%)
  • System prompt: ≈12 (0.0%)
  • User prompt: ≈8 (0.0%)
  • Document: ≈225 (0.2%)
  • Message overhead: ≈8 (0.0%)
  • Reply reserve: ≈2,048 (1.6%)
  • Remaining: ≈125,187 (97.8%)
Capacity calculations
Documents that fit557
Room for the document≈125,412 tokens
Suggested RAG chunk≈62,706 tokens
Overlap≈6,270 tokens

All counts are approximate; verify critical budgets with the model's own tokenizer.

Examples

Size a RAG document

Pick GPT-4o, paste your chunks into Document, set a 2048-token reply reserve and read how many documents fit plus the suggested chunk size.

Debug an overflowing request

Reduce the context to a small model or shrink the reply reserve and watch the red over-window count appear with per-segment percentages.

Compare two models

Turn on Compare models to see the same content against a second context size without re-entering any text.

About this tool

The Context Window Fill Visualizer models the whole request budget, not just one text count. Pick one of 30 models with published context sizes, a custom window, or compare two models side by side. Token counts use a documented heuristic — roughly four Latin characters per token and 1.5 for CJK — and are labeled with an approximation sign throughout; no wasm encoder is downloaded. A stacked bar breaks the window into system reserve, system prompt, user prompt, document, per-message overhead and a reply reserve, with the remaining slice and an explicit overflow count. Below the bar, capacity math shows how many documents of the pasted size fit, the room left for a document and a suggested RAG chunk size with overlap. Change reserves, message count or role-token framing to see the budget react immediately. All content stays in the browser tab.

What this tool does not do

  • Processes only the inputs provided in this session without connecting to external accounts or background servers.
  • Runs entirely in the current browser tab; nothing is synced across devices or backed up to a server.

How to use this tool

  1. Pick target model context size

    Choose a preset model context limit or enter a custom token ceiling and reply reserve.

  2. Paste prompt, history, and docs

    Fill system instructions, conversation turns, and retrieved RAG chunks.

  3. Check utilization and headroom

    Inspect the proportional fill bar, remaining tokens, and how many chunks fit safely.

Use cases

Size a RAG document

Pick GPT-4o, paste your chunks into Document, set a 2048-token reply reserve and read how many documents fit plus the suggested chunk size.

Debug an overflowing request

Reduce the context to a small model or shrink the reply reserve and watch the red over-window count appear with per-segment percentages.

Compare two models

Turn on Compare models to see the same content against a second context size without re-entering any text.

Common mistakes

Mistake:How does the visualizer help size RAG chunks?

Fix:Once system instructions, chat history, and reply reserve are subtracted from the model's context limit, the remaining budget shows exactly how many k-chunks of a given token size fit.

Mistake:Are token counts exact for every model family?

Fix:Counts reflect BPE/character-calibrated tokenization plus per-message chat-template overhead; check exact billing token counts with your provider's API when operating within 1–2% of the hard ceiling.

Frequently asked questions

Why reserve tokens for the model's output?

Most LLM APIs enforce a combined ceiling across input prompt tokens plus max_output_tokens; failing to reserve reply headroom causes truncated answers or context-overflow errors.

How does the visualizer help size RAG chunks?

Once system instructions, chat history, and reply reserve are subtracted from the model's context limit, the remaining budget shows exactly how many k-chunks of a given token size fit.

Are token counts exact for every model family?

Counts reflect BPE/character-calibrated tokenization plus per-message chat-template overhead; check exact billing token counts with your provider's API when operating within 1–2% of the hard ceiling.

Is pasted system-prompt or document text uploaded?

No. Segment sizing and context-bar rendering run locally in your browser.