Context Budget Calculator
Every AI RPG dev and every player building their own system prompt fights the same problem: a context window is finite, and most people eyeball how much of it they've already spent. A system prompt here, a world file there, a memory block that keeps growing — and nobody notices the budget is nearly gone until the model starts forgetting things around turn 50.
This tool makes the budget visible. Pick a model, paste in your system prompt, world file, and memory block, tell it roughly how many tokens a single turn costs, and it shows you how much context is left for actual play — and about how many turns until you hit the wall. No AI is called and nothing leaves your browser; the intelligence is in the math, not a generation step.
Set up your budget
Context window: —
~0 tokens
~0 tokens
~0 tokens
Short back-and-forth: ~100–200. Medium narrative turns: ~300–450. Long, descriptive prose: ~600+.
Your Budget
Choose a model above to see your budget.
Token counts are estimates (a blended character/word heuristic), not exact tokenizer output — real usage varies by roughly ±10–15% depending on the model's actual tokenizer. Context window figures are pulled from each provider's official docs as of July 2026 and can change — verify before relying on them for production use.
Why Context Budgets Matter
Almost every AI RPG platform and homebrew system prompt fights the same fixed cost before a single turn of play happens: the system prompt, the world file or lorebook, and any standing memory block all sit in the context window permanently, and every turn of actual conversation has to fit in whatever's left. Most builders eyeball this — write a prompt, load a world file, and find out the hard way when the model starts contradicting itself. This calculator turns that guess into a number. For a full breakdown of what typically eats that budget — with worked examples and real numbers — see the AI roleplay token budget guide.
How the Token Estimate Works
None of the major model providers ship a public, client-side tokenizer for their exact encoding — Claude, Gemini, Grok, and DeepSeek don't publish one at all, and even OpenAI's is a heavy download for a browser tool. So this calculator uses the same estimate for every model: a blend of characters ÷ 4 and words ÷ 0.75, averaged — the two most common back-of-envelope heuristics, applied consistently so the numbers stay comparable across models. It will not match a provider's official token count exactly, typically within about ±10–15% for ordinary prose. If you need an exact count for one specific model, use that provider's own token-counting API before finalizing a production system prompt.
What Counts Toward Your Context Window
The context window is shared by everything in the request, not just the visible conversation: your system prompt, world file or lorebook, memory block, the full running message history, and — depending on the model — tool definitions, uploaded images or documents, and even the model's own reasoning tokens all draw from the same pool. It's also worth knowing that some chat interfaces (as opposed to raw API access) manage long conversations on a rolling "first in, first out" basis rather than simply erroring out when the window fills — which is part of why a session can start subtly forgetting early details well before it visibly breaks.
Model Context Windows, Compared
Context windows shift with every model release, so treat this table as a snapshot verified against each provider's official documentation in July 2026, not a permanent fact. Flagship and "cheap tier" models from the same provider often carry the same context window — the price difference is about speed and reasoning depth, not how much the model can hold:
| Model | Context window | Tier |
|---|---|---|
| ChatGPT (GPT-5.4) | 1,050,000 tokens | Flagship |
| ChatGPT Mini (GPT-5.4 Mini) | 400,000 tokens | Cheap |
| Claude Sonnet 5 | 1,000,000 tokens | Flagship |
| Claude Opus 5 | 1,000,000 tokens | Flagship |
| Claude Fable 5 | 1,000,000 tokens | Premium |
| Claude Haiku 4.5 | 200,000 tokens | Cheap |
| Gemini 3.1 Pro | 1,000,000 tokens | Flagship |
| Gemini 3.6 Flash | 1,048,576 tokens | Cheap |
| Grok 4.5 | 500,000 tokens | Flagship |
| DeepSeek V4 Pro | 1,000,000 tokens | Flagship |
| DeepSeek V4 Flash | 1,000,000 tokens | Cheap |
| MiniMax M2 (Her) | 200,000 tokens | Cheap |
A large published context window is a ceiling, not a guarantee of quality — most models' recall degrades well before that ceiling ("context rot"), which is exactly why keeping your fixed content lean matters more than chasing the largest number on this table. See the best LLM for roleplay guide for how these models actually perform in long campaigns, not just how much they can technically hold.
What to Do When You're Close to the Wall
If the calculator shows only a handful of turns left, the fixed content is the first place to cut — a leaner world file or a tighter memory block buys back far more room than trimming the conversation itself. The Campaign Memory Tool exists for exactly this: it tracks your campaign state in structured fields and generates a compression prompt that turns a sprawling history into a compact memory block under 500 words. For the underlying mechanics — why models drift before they hit the hard limit, and the fixes that work — read why AI campaigns fall apart at turn 50. And if you'd rather start from a system that manages this for you, the Arcanum Originals have compression and state management engineered in from the start.