LLM Context Window Calculator

A context window is the total number of tokens a model can hold in mind at once — and your prompt has to share that space with everything else in the request. The document you paste is only one part of it. The system prompt rides along on every call, the chat history gets resent with every new message, and the reply itself needs room that has to exist before the model starts writing. Add those four parts up and plenty of prompt stacks that “should fit” quietly don’t.

This calculator does the adding for you. Paste your main text and it’s estimated live; enter the system prompt, chat history and reserved output as token counts; and the whole stack is checked against 20 current models from OpenAI, Anthropic, Google, DeepSeek, Mistral and xAI in one table — total tokens needed, percentage of the window used, tokens left, and a plain FITS or OVERFLOW for every model. No model-hopping, no re-pasting your text into twenty different checkers.

It’s the middle step of the three developer utilities on this hub. The LLM Token Counter measures a prompt, this calculator checks whether the full stack fits, and the LLM API Cost Calculator prices the same workload on the same 20 models — the two tables use the same model order, so you can read them side by side.

A developer's desk with a laptop showing a blurred chart, an open notebook of handwritten notes, a calculator and a mug of coffee

LLM Context Window Calculator

Paste your main text, add the system prompt, chat history and the reply length you need to reserve, and see — for 20 current models at once — how much of each context window your prompt stack uses, how many tokens are left, and exactly where it overflows.

Estimated tokens in this text: ~0
Counted live with the same estimator as this hub’s LLM Token Counter. It is an estimate, not an official count — see the note under the results for how it works.
The instructions you send with every request. Counted exactly as entered — no estimate applied.
The conversation so far, resent with each new message. This is the part that grows quietly until a request fails.
Room set aside for the reply, including thinking tokens on reasoning models. The window has to hold this too.
~0Tokens in your text (base estimate)
0System + history + reserved
0Total stack (base-estimate models)
0 of 20Models your stack fits in

ModelContext windowYour totalWindow usedTokens leftStatus

How the estimate works — and why it is labelled an estimate. Your text is split into chunks: words, numbers, individual symbols and whitespace runs. A word scores roughly one token per 4–5 letters, a run of digits about one per 3 digits, each symbol one token, and long whitespace runs (indentation, blank lines) a little extra. That base count is the figure used for most models. Claude models are checked against a higher figure — the base × 1.2 — because published comparisons of the same texts through Anthropic’s own counting tools consistently land roughly 15–30% above the base-style count; that calibration is the one this hub’s LLM Token Counter already uses, so the two tools agree. No such published calibration exists for the other providers in the table, so their rows use the base estimate rather than an invented adjustment. On ordinary English prose this estimator usually lands within about ±20% of a provider’s official count; code, JSON, URLs and non-English text can miss by more. The three token fields are added exactly as you enter them — only the pasted text is estimated. For an exact figure before a large paid run, or when a row sits close to 100%, use the provider’s own counter. Nothing is uploaded: your text is counted locally in your browser.

About the window table: every window size was checked on 21 November 2026 against the provider’s own documentation — OpenAI, Anthropic, Google, DeepSeek, Mistral and xAI. Providers publish their sizes in different forms — OpenAI states 1,050,000 exactly, Google 1,048,576, Anthropic and DeepSeek a rounded “1M” — and the table keeps each provider’s own figure rather than tidying them into one. One accounting note: on Gemini 4 models the window is a single shared budget for input, thinking and output, which is exactly the sum this calculator checks. Providers revise window sizes, so confirm the row that matters on the provider’s model page before you build against it. Once your stack fits, the LLM API Cost Calculator prices the same workload on the same 20 models.

How it works

The arithmetic is simple, and it’s printed here rather than hidden: total needed = estimated tokens in your text + system prompt + chat history + reserved output, compared against each model’s published context window. Tokens left is the window minus your total; a negative figure is an overflow, and the row says by how much.

Your pasted text is estimated with the same counter this hub’s LLM Token Counter uses, so the two tools agree on the same text. The text is split into chunks — words, numbers, individual symbols and whitespace runs. A word scores roughly one token per 4–5 letters, a run of digits about one per 3 digits, each symbol one token, and long whitespace runs (indentation, blank lines) a little extra. Claude models are then checked against a higher figure — that base count × 1.2 — because published comparisons of the same texts through Anthropic’s own counting tools consistently land roughly 15–30% above the base-style count. No equivalent published calibration exists for the other providers, so their rows use the base estimate rather than an invented adjustment.

That’s also the honest note about what these numbers are: estimates, not official tokenizer counts. Every model family splits text differently — the same paragraph genuinely is a different number of tokens in GPT, Claude and Gemini — and no browser-side estimator reproduces a provider’s tokenizer exactly. On ordinary English prose this one usually lands within about ±20% of an official count; code, JSON, URLs and non-English text can miss by more. Treat a row at 60% as comfortable and a row at 97% as a warning, and when a decision rides on a close call, confirm it with the provider’s own counter before you build. The three token fields, by contrast, are added exactly as you enter them — if you’ve counted your system prompt precisely, that precision carries through.

Every window size in the table was checked on 21 November 2026 against the provider’s own documentation, and the tool links to all six sources. Providers publish their sizes in different forms — OpenAI states 1,050,000 exactly, Google 1,048,576, Anthropic and DeepSeek a rounded “1M” — and the table keeps each provider’s own figure instead of tidying them into one. One accounting point worth knowing: on Gemini 4 models the window is a single shared budget covering input, thinking and output together, which is exactly the sum this calculator checks.

How to use it

  1. Paste your main text — the document, retrieved passages or long prompt — into the text box. Its token estimate updates as you type, in both the base and Claude-style figures.
  2. Enter your system prompt’s token count. If you haven’t counted it, paste it into the text box first, note the estimate, then put your main text back.
  3. Enter the chat history tokens — the whole conversation that gets resent with the next message, not just the last exchange.
  4. Enter the output you want to reserve. On reasoning models, include thinking tokens; they spend from the same window.
  5. Read the table top to bottom: your total per model, the percentage of its window used, the tokens left, and the FITS or OVERFLOW status. The line above the table names any models that overflow and the tightest fit among the rest.
  6. Press Copy results to take the whole check away as plain text for a design doc or a team chat, or Print for a paper copy.
  7. Starting from scratch? Load the worked example resets the tool to the scenario below so you can see a real overflow before you paste your own text.

Worked example

The calculator opens on this example. The pasted text is a short support-assistant instruction paragraph, which the estimator counts at ~81 tokens on the base estimate and ~97 tokens on the Claude-style estimate. The three fields are set to a system prompt of 2,000 tokens, a chat history of 210,000 tokens and 8,000 tokens reserved for the reply — fixed additions of 220,000 tokens. So the stack totals 220,081 tokens on base-estimate models and 220,097 tokens on the Claude rows.

The stack fits in 19 of the 20 models — and the one failure is the instructive part:

  • Claude Haiku 4.5 — OVERFLOW. It needs 220,097 tokens against a 200,000-token window: over by 20,097 tokens (110% of the window). Nothing about the document caused this — the 210,000-token history did.
  • Mistral Large 3 and Mistral Small 4 — the tightest fit. 220,081 of their 256,000-token windows: 85.97% used, 35,919 tokens left. Comfortable today, but a few more weeks of growing history ends that.
  • GPT-6.2 Astra — room to spare. 220,081 of 1,050,000 tokens: 20.96% used, 829,919 left. The Gemini 4 models sit in the same territory (220,081 of 1,048,576, 20.99%), and Grok 4.7 uses 44.02% of its 500,000-token window.

Same stack, four very different answers — which is the whole reason the check runs against every model at once instead of the one you happened to pick first.

Who it is for

Developers sizing a RAG pipeline or a document workflow against a model’s real limits before they commit to it; chatbot builders watching a growing conversation history approach the ceiling; teams choosing between models for a long-document feature and needing one honest comparison; and anyone who has met the “prompt is too long” error in production and would rather meet it here first.

Why use this tool

  • The whole stack, not just the document — system prompt, history and reserved output are separate inputs, because they’re the parts that actually push a prompt over the limit.
  • Every model at once — one paste checks 20 current models across six providers, with the percentage used, the tokens left and the exact overflow figure per model.
  • A dated, sourced window table — every window size was checked against the provider’s own documentation on 21 November 2026, each provider’s figure kept in its own published form, with the sources linked on the tool.
  • Estimates that agree across the hub — the same counter as the LLM Token Counter, with the Claude calibration stated openly, so the number you measured there is the number that gets checked here.

FAQ

What is a context window?

It’s the maximum number of tokens a model can consider in a single request — everything you send plus everything it generates has to fit inside it. A 200,000-token window doesn’t mean you can send a 200,000-token document: the system prompt, the conversation history and the reply all spend from the same budget, and on some models (Gemini 4, for instance) the thinking tokens do too. When the total crosses the limit, the API rejects the request or silently truncates it, depending on the provider.

How does this calculator estimate the tokens in my text?

With a chunk-based estimator that runs entirely in your browser — the same one this hub’s LLM Token Counter uses. Your text is split into words, numbers, symbols and whitespace runs, and each chunk is scored by rules that approximate how real tokenizers behave: roughly a token per 4–5 letters of a word, one per 3 digits, one per symbol. Claude models are checked against that count × 1.2, matching published comparisons against Anthropic’s own counting tools. It’s an estimate — usually within about ±20% on English prose — not an official count from any provider’s tokenizer.

Why does the same prompt stack show different totals for different models?

Two reasons. The windows themselves differ — 200,000 tokens on Claude Haiku 4.5 against 1,050,000 on the GPT-6 line — so the same total is a different percentage of each. And the total itself shifts slightly: the Claude rows use the higher calibrated estimate for your pasted text (97 tokens instead of 81 in the worked example), because Claude’s tokenizer genuinely produces more tokens for the same text. The three fields you type in are identical on every row; only the text estimate is calibrated per family.

Why is chat history a separate input?

Because it’s the part that grows without anyone deciding it should. Every new message resends the whole conversation, so a support bot or a coding assistant accumulates history tokens turn after turn — the worked example’s 210,000-token history is what overflows Claude Haiku 4.5, not the document. Keeping it as its own field lets you test the question that matters in production: how many more turns before this conversation hits the wall?

Does the reserved output really need to fit in the window?

Yes. The window covers the reply as well as the prompt — if your input leaves only 500 tokens and the model needs 2,000 to answer, the response gets cut short or the request fails, depending on the provider and your settings. Reasoning models spend part of that room on thinking tokens before the visible answer starts. Reserving output explicitly, the way this calculator does, is what turns “it fit when I tested it” into “it still fits when the model has something long to say”.

How current are the context window sizes in the table?

Every figure was checked on 21 November 2026 against the provider’s own model documentation — OpenAI, Anthropic, Google, DeepSeek, Mistral and xAI — and the tool links to all six sources so you can verify any row yourself. Providers do revise window sizes as models are updated, so if a row is close to your limit, confirm it on the provider’s model page before you build against it.

What is a context window?

It’s the maximum number of tokens a model can consider in a single request — everything you send plus everything it generates has to fit inside it. A 200,000-token window doesn’t mean you can send a 200,000-token document: the system prompt, the conversation history and the reply all spend from the same budget, and on some models (Gemini 4, for instance) the thinking tokens do too. When the total crosses the limit, the API rejects the request or silently truncates it, depending on the provider.

How does this calculator estimate the tokens in my text?

With a chunk-based estimator that runs entirely in your browser — the same one this hub’s LLM Token Counter uses. Your text is split into words, numbers, symbols and whitespace runs, and each chunk is scored by rules that approximate how real tokenizers behave: roughly a token per 4–5 letters of a word, one per 3 digits, one per symbol. Claude models are checked against that count × 1.2, matching published comparisons against Anthropic’s own counting tools. It’s an estimate — usually within about ±20% on English prose — not an official count from any provider’s tokenizer.

Why does the same prompt stack show different totals for different models?

Two reasons. The windows themselves differ — 200,000 tokens on Claude Haiku 4.5 against 1,050,000 on the GPT-6 line — so the same total is a different percentage of each. And the total itself shifts slightly: the Claude rows use the higher calibrated estimate for your pasted text (97 tokens instead of 81 in the worked example), because Claude’s tokenizer genuinely produces more tokens for the same text. The three fields you type in are identical on every row; only the text estimate is calibrated per family.

Why is chat history a separate input?

Because it’s the part that grows without anyone deciding it should. Every new message resends the whole conversation, so a support bot or a coding assistant accumulates history tokens turn after turn — the worked example’s 210,000-token history is what overflows Claude Haiku 4.5, not the document. Keeping it as its own field lets you test the question that matters in production: how many more turns before this conversation hits the wall?

Does the reserved output really need to fit in the window?

Yes. The window covers the reply as well as the prompt — if your input leaves only 500 tokens and the model needs 2,000 to answer, the response gets cut short or the request fails, depending on the provider and your settings. Reasoning models spend part of that room on thinking tokens before the visible answer starts. Reserving output explicitly, the way this calculator does, is what turns “it fit when I tested it” into “it still fits when the model has something long to say”.

How current are the context window sizes in the table?

Every figure was checked on 21 November 2026 against the provider’s own model documentation — OpenAI, Anthropic, Google, DeepSeek, Mistral and xAI — and the tool links to all six sources so you can verify any row yourself. Providers do revise window sizes as models are updated, so if a row is close to your limit, confirm it on the provider’s model page before you build against it.