Skip to content

Context Window Calculator

See what fits in an AI model's context window, in words, pages and lines of code, and how much of it your text takes up.

More options

Check your model's real limit with its provider. Here 1K = 1,000 tokens.

Your text stays in this browser. Pasted text replaces the amount above.

Instructions, tool definitions and anything sent with every message.

Depends on the model and image size. Check your provider's vision docs.

Rough guesses: other languages and scripts usually take more tokens than English for the same text. Pasted text is estimated by its script instead.

ResultRough English estimates—Words fit in the window—Pages (500 words)—Book chapters (4,000 words)—Lines of code (10 tokens)—Your text in tokens—Of the window used—Tokens left

How your context window is worked out

Tokens in, words and pages out. 1 token ≈ ¾ of an English word.

  1. 1

    Your window

    128,000 tokens

  2. 2

    Set space aside

    − 0 for the reply− 0 system prompt= 128,000 free

  3. 3

    Turn it into words

    128,000 × 0.75= 96,000 words÷ 500 = 192 pages

  4. 4

    Fit your text

    33,333 ÷ 128,000= 26% used94,667 tokens left

Read more: the formula, a worked example and rules of thumb

A context window is the most text an AI model can read at once, counted in tokens. A token is a chunk of text, about ¾ of an English word or 4 characters. Everything you send (system prompt, documents, images, chat history, your question) and, for most models, the reply it writes must fit inside it. These are rough English rules of thumb; each model's tokenizer counts a little differently. For an exact count of your own text, use the AI token counter.

The formula

space kept aside = reply room + system prompt + images × tokens per image
free space = window − space kept aside
words that fit = free space × 0.75 ÷ language factor
pages = words ÷ words per page · chapters = words ÷ words per chapter
lines of code = free space ÷ tokens per line
your text in tokens = words × 4 ÷ 3 (pages × words per page × 4 ÷ 3, characters ÷ 4) × language factor
% used = (space kept aside + your text) ÷ window × 100
chat turns = tokens left ÷ tokens per turn (rounded down)
RAG chunks that fit = tokens left ÷ chunk size (rounded down)
chunks a document makes = (document − overlap) ÷ (chunk size − overlap), rounded up

Worked example

A 128,000-token window with nothing kept aside holds 128,000 × 0.75 = 96,000 words. At 500 words a page that is 96,000 ÷ 500 = 192 pages, or 96,000 ÷ 4,000 = 24 chapters, and 128,000 ÷ 10 = 12,800 lines of code. A 50-page report is 50 × 500 = 25,000 words, and 25,000 × 4 ÷ 3 = 33,333 tokens. That is 33,333 ÷ 128,000 = 26% of the window, leaving 94,667 tokens, or about 71,000 more words.

In Advanced, keep 4,000 tokens for the reply and 1,000 for the system prompt. Then 128,000 − 5,000 − 33,333 = 89,667 tokens are left. With 500 tokens per chat turn, 89,667 ÷ 500 = 179 turns fit. With 500-token RAG chunks, 179 chunks fit; a 100,000-token document cut into 500-token chunks overlapping by 50 makes (100,000 − 50) ÷ 450 = 222.1, so 223 chunks, and you can send about 80% of them at once.

Rules of thumb

WindowWordsPages (500 words)Lines of code
8K6,00012800
32K24,000483,200
128K96,00019212,800
200K150,00030020,000
1M750,0001,500100,000
  • 1 token ≈ 4 characters ≈ ¾ of an English word. 100 tokens ≈ 75 words.
  • Code uses more tokens per character than prose because of symbols and indentation. 10 tokens a line is a middle guess; minified or very long lines take more.
  • Other languages often take 1.3 to 3 times the tokens of English for the same meaning. The multipliers here are rough guesses, not measured for any one model.
  • Images are turned into tokens too; the number depends on the model and image size, so enter your provider's figure.
  • Filling the window isn't always wise: models can miss details in the middle of very long inputs, and long prompts cost more. Send only what the task needs.

The page doesn't list named models because their limits change often. The window sizes are common round sizes only.

Common questions

What is a context window?

It is the most text an AI model can look at in one go, measured in tokens. Everything counts towards it: the system prompt, your message, any documents or images, the chat so far and the reply the model writes. When a chat gets longer than the window, the oldest parts are cut or summarised.

How many words fit in a 128K context window?

About 96,000 English words, because one token is roughly ¾ of a word: 128,000 × 0.75 = 96,000. At 500 words a page that is about 192 pages, or around 24 book chapters of 4,000 words. Leave some room for the reply.

How many pages is 1 million tokens?

Roughly 1,500 pages of English: 1,000,000 × 0.75 = 750,000 words, and 750,000 ÷ 500 words a page = 1,500 pages. Code, tables and other languages use more tokens, so less fits.

Does the reply count towards the context window?

Yes, for most models the window holds both what you send and what the model writes back. If your prompt fills the whole window there is no room left for an answer, so keep space for the reply (the model's maximum output tokens).

Why do other languages use more tokens?

Tokenizers are trained mostly on English, so English words are often one token while words in other languages, and especially other scripts like Hindi, Thai or Arabic, are split into more pieces. The same text can take 1.3 to 3 times as many tokens. The multipliers here are rough guesses; newer tokenizers narrow the gap.

How many RAG chunks can I send?

Take the free space after the system prompt, your question and the reply, and divide by the chunk size. With 89,667 tokens free and 500-token chunks, about 179 chunks fit. Overlap does not change how many chunks fit, but it means each chunk adds less new text.

Related calculators

AI token counterCount tokens, words and characters in your text, exact for OpenAI, with cost per model and context-window fill.LLM API cost calculatorMonthly AI API bill, with caching and batch, across models.LLM VRAM calculatorHow much GPU memory an AI model needs to run or fine-tune: weights, KV cache and overhead, which GPUs and Macs fit, how many you need and a rough speed.Cheapest AI API calculatorSame open model, different providers: who is cheapest for your usage.

Made by Zulu Calculator, part of AlphaZulu LLC. Formulas are shown in full and rule figures are checked against official sources; see how we build calculators.

Embed this calculator on your site

Free to use on your website or blog. Paste this code where you want the calculator to appear. Please keep the credit link.

Context window calculator by Zulu Calculator ↗