
TL;DR
A language model reads tokens, not letters or words. The context window is everything it can look at while it writes, counted in tokens too. A bigger window does not guarantee that the model uses all of it well.
- Purpose: Tokens are the units a model reads and writes, and the window limits how many fit into a request.
- Size: Google's Gemini documentation says a token is about 4 characters, and 100 tokens equal about 60 to 80 English words.
- Parts: The window holds the system prompt, every message, tool definitions and the model's own answer.
- Limit: Anthropic says accuracy and recall degrade as the token count grows, and calls this context rot.
What a token is
Language models work on numbers, not on text. The tiktoken library from OpenAI puts it this way: “Language models don't see text like you and I, instead they see a sequence of numbers (known as tokens).”
Anthropic's glossary gives the unit a size: “Tokens are the smallest individual units of a language model, and can correspond to words, subwords, characters, or even bytes (in the case of Unicode).”
Google's Gemini documentation gives examples. “Tokens can be single characters like z or whole words like cat. Long words are broken up into several tokens.”
The same page names two terms. The set of all tokens a model uses is its vocabulary. Splitting text into tokens is called tokenization.
This article builds on the model itself. The article on large language models explains what a model does with the tokens: What Is an LLM? Large Language Models Explained
Why words are split into pieces
A fixed vocabulary has a problem. Rare and unknown words are not in it. Rico Sennrich, Barry Haddow and Alexandra Birch described this for machine translation in a paper first submitted on August 31, 2015.
Their answer was “encoding rare and unknown words as sequences of subword units”. The paper used a segmentation based on the byte pair encoding compression algorithm. On two WMT 15 translation tasks, subword models improved over a dictionary baseline by 1.1 and 1.3 BLEU.
The tiktoken documentation lists what byte pair encoding (BPE) offers for tokenizing text. It is “reversible and lossless”, so the tokens convert back into the original text. It “works on arbitrary text, even text that is not in the tokeniser's training data”.
It also compresses. “On average, in practice, each token corresponds to about 4 bytes.” The documentation adds that BPE lets the model see common subwords. Its example is the word “encoding”, which BPE will often split into “encod” and “ing”.
How many tokens is a text
There is no single answer, because every model family has its own tokenizer. Google gives a rule for Gemini: “For Gemini models, a token is equivalent to about 4 characters. 100 tokens is equal to about 60-80 English words.”
Anthropic says the number depends on the model and the language. Its glossary states that on earlier models a token represents approximately 3.5 English characters. Newer models use a tokenizer that “produces approximately 30 percent more tokens for the same text than earlier models”.
That has a practical consequence. Anthropic's documentation says: “don’t reuse token counts measured on the older model to estimate costs or context window fit.” To get exact numbers, use the counting function of the model you plan to use.
Both vendors offer one. Anthropic says its token counting is “free to use” but subject to rate limits. Google says all input to and output from the Gemini API is tokenized, “including text, image files, and other non-text modalities”. It adds that the cost of a call is determined in part by the number of input and output tokens.
What a context window is
Anthropic defines it like this: “The “context window” refers to all the text a language model can reference when generating a response, including the response itself.” It calls the window a “working memory” for the model. That is different from the large corpus the model was trained on.
Google uses a similar picture: “An analogy for the context window is short term memory.”
Everything in a request counts. Anthropic lists the system prompt, every message including tool results, images and documents, and the tool definitions. The output counts too, including extended thinking.
Each turn of a chat adds to the window. Previous turns are preserved completely, so a long conversation approaches the limit step by step.
Google adds a detail for its newest model. In Gemini 4, the 1M-token window is “shared across input, thinking, and output tokens”. Earlier Gemini 3 and 2.5 models use separate budgets of 1M input and 64K output.
The numbers over time
The size of the window has grown. GPT-3, described by OpenAI researchers in a paper submitted on May 28, 2020, used a context window of 2,048 tokens. The paper writes it as nctx = 2048.
Google's documentation gives a later history. It says: “Earlier versions of generative models were only able to process 8,000 tokens at a time. Newer models pushed this further by accepting 32,000 or even 128,000 tokens.” It then claims that Gemini is the first model capable of accepting 1 million tokens. That is Google's statement about its own product.
Anthropic's documentation, fetched on November 5, 2026, says its context window goes “up to 1M tokens, depending on the model”. It lists the models with a 1M-token window. Other Claude models, including Claude Sonnet 4.5 (deprecated), have a 200k-token window. A single request to a 1M model can generate up to 128k output tokens.
Google offers a picture of what 1 million tokens looks like. It names 50,000 lines of code at 80 characters per line, or 8 average length English novels, or the transcripts of over 200 average length podcast episodes.
Images and documents have their own limit. A single Anthropic request can include up to 600 images or PDF pages, and 100 for models with a 200k-token window. Anthropic notes that you might reach request size limits before the token limit.
Why more is not always better
Anthropic's documentation says it plainly: “more context isn’t automatically better.” Its explanation: “As token count grows, accuracy and recall degrade, a phenomenon known as context rot.” It concludes that curating what is in context matters as much as how much space is available.
A research paper measured part of this. Nelson Liu and colleagues submitted “Lost in the Middle” on July 6, 2023. They tested multi-document question answering and key-value retrieval.
Their finding: “performance is often highest when relevant information occurs at the beginning or end of the input context, and significantly degrades when models must access relevant information in the middle of long contexts, even for explicitly long-context models.”
The authors concluded that “current language models do not robustly make use of information in long input contexts”. The paper tested models available in 2023. It does not say how the models of 2026 behave, and this article does not claim it.
What to take from the numbers
A token count is a measure of size, not of meaning. The same text has different counts in different models. A window of 1 million tokens is a ceiling, not a promise that every token in it is used equally well.
Two habits follow from the sources. Count tokens with the tokenizer of the model you will call, before you send a long request. And treat a long context as something to curate, as Anthropic says.
Sources
- Tom B. Brown et al., Language Models are Few-Shot Learners (arXiv 2005.14165, May 28, 2020): https://arxiv.org/abs/2005.14165
- Rico Sennrich, Barry Haddow, Alexandra Birch, Neural Machine Translation of Rare Words with Subword Units (arXiv 1508.07909, August 31, 2015): https://arxiv.org/abs/1508.07909
- Nelson F. Liu et al., Lost in the Middle: How Language Models Use Long Contexts (arXiv 2307.03172, July 6, 2023): https://arxiv.org/abs/2307.03172
- OpenAI, tiktoken README: https://github.com/openai/tiktoken
- Anthropic, Glossary (Claude documentation): https://platform.claude.com/docs/en/about-claude/glossary
- Anthropic, Context windows (Claude documentation): https://platform.claude.com/docs/en/build-with-claude/context-windows
- Anthropic, Token counting (Claude documentation): https://platform.claude.com/docs/en/build-with-claude/token-counting
- Google, Understand and count tokens (Gemini API documentation): https://aistudio.google.com/docs/tokens
- Google, Long context (Gemini API documentation): https://aistudio.google.com/docs/long-context







