See what percentage of a model's context window your conversation is using, how many tokens remain, and how many more turns you can fit before it fills up.
Enter your details and click Calculate to see results
Every LLM has a hard ceiling on how many tokens it can read and write in a single request, called its context window. As a conversation grows — more turns, more retrieved documents, more tool output pasted back in — that fixed budget fills up, and once you hit the limit the next request simply fails rather than degrading gracefully. This context window usage calculator lets you enter how many tokens your conversation has already consumed, how much you're reserving for the next reply, and how fast the conversation typically grows per turn, so you can see exactly how much runway you have left before you need to intervene.
Pick a model to load its published context window size — anywhere from 128K tokens for GPT-4o, DeepSeek V3, and Llama 3 70B, up to 2M tokens for Gemini 1.5 Pro. The calculator adds your "tokens already used" figure to your "tokens reserved for output" figure to get total committed tokens, expresses that as a percentage of the model's context window, and subtracts it from the window size to show tokens remaining. Dividing tokens remaining by your average tokens added per turn gives a rough estimate of how many more conversation turns you can have before the window fills up completely — and if you're already over the limit, a warning banner appears immediately.
Long-running chat sessions, agentic loops that re-read tool output every step, and RAG pipelines that stuff retrieved documents into the prompt are the most common ways applications quietly run out of context window in production. Catching this ahead of time — rather than discovering it via a failed API call in front of a user — lets you build in mitigations proactively: summarizing older history, trimming retrieved context to only what's relevant, or switching a long-lived session to a model with a larger window before it becomes a problem.
Periodically compress older turns into a short recap and replace the original messages with it. This resets your token budget while preserving the important context the model needs going forward.
Keep only the most recent N turns plus a fixed system prompt, dropping the oldest messages as new ones arrive. Simple to implement but can lose relevant early context in long sessions.
Instead of pasting entire documents into every turn, store them externally and retrieve only the most relevant snippets per request (RAG), which keeps per-turn token growth much lower.
Common questions about context window limits
Explore other AI & tech tools