Explainer
Tokens and context windows: how AI models read and remember
Language models read text as tokens, which can be whole words, pieces of words or single characters; for Google's Gemini models a token averages about 4 characters, so 100 tokens is roughly 60 to 80 English words.[1][2] The context window is the number of tokens a model can work with at once, and everything in a request counts toward it: the instructions, the conversation, attached files and the model's own reply.[3][4] Windows have grown from about 8,000 tokens in earlier models to 1 million or more in 2026, but accuracy and recall can still fall as the context fills up.[5][6][7]
This page explains the units AI language models work in and the limit on how much they can take in at once. For how the models themselves are built, see how large language models work and how transformers work.
What a token is
Language models work on tokens, which can be whole words, subwords (parts of a word) or single characters.[1] Google’s glossary gives the example of a model that splits “dogs” into two tokens, the root “dog” and the plural suffix “s”.[8] Long words are broken into several tokens, and the full set of tokens a model knows is called its vocabulary.[9]
Splitting words into smaller pieces lets a model handle words it has never seen. A 2015 paper by Sennrich and colleagues proposed encoding rare and unknown words as sequences of subword units, using a method based on the byte pair encoding compression algorithm.[10] Inside the model, each token is turned into an embedding, a list of numbers, which the Transformer’s attention layers then process; see how embeddings work.[11]
Counting tokens
There is no fixed exchange rate between words and tokens. Google says that for Gemini models a token is about 4 characters, and 100 tokens is about 60 to 80 English words.[2] Different models split text differently: Anthropic says the newer tokenizer in its recent Claude models produces approximately 30 percent more tokens from the same text than earlier models, with the exact increase depending on the content.[12]
Tokens are not only text. Google says all input to and output from the Gemini API is tokenized, including images and other non-text inputs.[13] In its documentation, a small image counts as 258 tokens, larger images are split into tiles of 258 tokens each, and audio counts as 32 tokens per second.[14]
Token counts matter for cost. Google says the price of a Gemini API call is determined in part by the number of input and output tokens.[15] Developers can estimate usage before sending a request: Anthropic recommends its token counting API for this and notes that the count is an estimate.[16]
What the context window holds
Google’s glossary defines the context window as the number of tokens a model can process in a given prompt, and says a larger window lets the model use more information.[3] Anthropic describes it as all the text the model can reference when generating a response, including the response itself, and distinguishes it from the large body of data the model was trained on.[3][17]
Everything in a request counts. Anthropic lists the system prompt, every message, tool results, images, documents and tool definitions, plus the output the model writes.[4] When a model uses extended thinking, those thinking tokens count toward the limit too.[18] Prompt caching lowers what is paid for repeated material but does not free up space: cached prompt prefixes still occupy the window.[19]
How windows have grown
Google says earlier generative models could process only about 8,000 tokens at a time, and later models accepted 32,000 or 128,000.[5] As of November 2026, Anthropic lists a 1-million-token context window for most of its current Claude models, and Google says many Gemini models have windows of 1 million or more tokens.[6] Google estimates that 1 million tokens is roughly 50,000 lines of code or eight average-length English novels.[20]
Smaller windows force trade-offs. Google says they often require dropping old messages, summarizing content, using retrieval-augmented generation with vector databases, or filtering prompts to save tokens.[21] Anthropic says chat interfaces such as claude.ai can manage the window on a rolling basis, and its server-side compaction summarizes earlier parts of a conversation so it can continue past the limit.[22]
Limits of long context
A bigger window does not guarantee the model uses all of it well. Anthropic’s documentation says that as the token count grows, accuracy and recall degrade, which it calls context rot.[7] A 2023 study found that models often performed best when the relevant information sat at the beginning or end of a long input and significantly worse when it was in the middle, even for models built for long contexts.[23] Google says Gemini models score highly at finding a single fact in a long context but are less accurate when looking for several pieces of information at once.[24]
Long contexts are also expensive to compute. In a Transformer, self-attention makes every token learn its relevance to every other token, so the work grows with the square of the number of tokens.[25] For why models sometimes give confident but wrong answers, see AI hallucinations.
Read next
Artificial intelligence: a crash course
A sourced crash course on AI in 2026: how models work, open vs closed weights, the frontier labs, jobs, copyright, state laws and safety.
Questions readers ask
What is a token in AI?
A token is the unit a language model reads and writes. It can be a whole word, part of a word or a single character. Google's glossary gives the example of "dogs" being split into "dog" and "s", and says that in computer vision a token can be part of an image.[1][8]
How many words is 1,000 tokens?
It depends on the model and the text. Google says that for Gemini models a token is about 4 characters and 100 tokens is about 60 to 80 English words, so 1,000 tokens is very roughly 600 to 800 words. Anthropic says its newer tokenizer produces about 30 percent more tokens than its earlier one for the same text.[2][12]
What is a context window?
The number of tokens a model can process at once. Anthropic describes it as all the text the model can reference when generating a response, including the response itself, and says it is separate from the data the model was trained on.[3][17]
How big are context windows in 2026?
As of November 2026, Anthropic lists a 1-million-token context window for most of its current Claude models, and Google says many Gemini models have windows of 1 million or more tokens. Google estimates 1 million tokens is about 50,000 lines of code or eight average-length novels.[6][20]
Sources
· 25 claims from 4 publishers
Each numbered claim is a statement we checked against the sources listed with it. Tap a number in the text to see its sources in place.
- [1]
Language models work on tokens, which can be whole words, subwords (parts of a word) or single characters. confirmedas of 2026-11-07
- LLMs: What's a large language model? (Machine Learning Crash Course) · Google for Developers · Primary source · LLMs: What's a large language model? (retrieved 2026-11-07)
- [2]
Google says that for Gemini models a token is about 4 characters, and 100 tokens equal about 60 to 80 English words. confirmedas of 2026-11-14
- Understand and count tokens (Gemini API) · Google AI for Developers · Primary source · Understand and count tokens (retrieved 2026-11-14)
- [3]
Google's glossary defines a context window as the number of tokens a model can process in a given prompt, and Anthropic describes it as all the text a model can reference when generating a response, including the response itself. confirmedas of 2026-11-14
- Machine Learning Glossary · Google for Developers · Primary source · Glossary, context window (retrieved 2026-11-07)
- Context windows (Claude API documentation) · Anthropic · Primary source · How the context window works (retrieved 2026-11-14)
- [4]
Anthropic says everything in a request counts toward the context window, including the system prompt, every message, tool results, images, documents and tool definitions, as well as the output the model generates. confirmedas of 2026-11-14
- Context windows (Claude API documentation) · Anthropic · Primary source · How the context window works (retrieved 2026-11-14)
- Context windows (Claude API documentation) · Anthropic · Primary source · How the context window works (retrieved 2026-11-14)
- [5]
Google says earlier generative models could process only 8,000 tokens at a time, and newer models then accepted 32,000 or 128,000 tokens. confirmedas of 2026-11-14
- Long context (Gemini API) · Google AI for Developers · Primary source · Getting started with long context (retrieved 2026-11-14)
- [6]
As of November 2026, Anthropic lists a 1-million-token context window for most of its current Claude models, and Google says many Gemini models have context windows of 1 million or more tokens. confirmedas of 2026-11-14
- Context windows (Claude API documentation) · Anthropic · Primary source · Context window sizes by model (retrieved 2026-11-14)
- Long context (Gemini API) · Google AI for Developers · Primary source · Long context (retrieved 2026-11-14)
- [7]
Anthropic's documentation says that as the token count grows, accuracy and recall degrade, which it calls context rot. confirmedas of 2026-11-14
- Context windows (Claude API documentation) · Anthropic · Primary source · How the context window works (retrieved 2026-11-14)
- [8]
Google's machine learning glossary says a language model that uses subwords as tokens might split "dogs" into two tokens, "dog" and the plural suffix "s", and that in computer vision a token can be part of an image. confirmedas of 2026-11-14
- Machine Learning Glossary · Google for Developers · Primary source · Glossary, token (retrieved 2026-11-07)
- Machine Learning Glossary · Google for Developers · Primary source · Glossary, token (retrieved 2026-11-07)
- [9]
Google's Gemini documentation says long words are broken into several tokens and calls the set of all tokens a model uses its vocabulary. confirmedas of 2026-11-14
- Understand and count tokens (Gemini API) · Google AI for Developers · Primary source · About tokens (retrieved 2026-11-14)
- [10]
A 2015 paper by Sennrich and colleagues proposed encoding rare and unknown words as sequences of subword units, including a segmentation based on the byte pair encoding compression algorithm. confirmedas of 2015-08-31
- Neural Machine Translation of Rare Words with Subword Units · arXiv · Primary source · 2015-08-31 · Abstract (retrieved 2026-11-14)
- Neural Machine Translation of Rare Words with Subword Units · arXiv · Primary source · 2015-08-31 · Abstract (retrieved 2026-11-14)
- [11]
A self-attention layer transforms a sequence of embeddings, such as token embeddings, into another sequence of embeddings, and self-attention is one of the main building blocks of Transformers. confirmedas of 2026-11-07
- Machine Learning Glossary · Google for Developers · Primary source · Glossary, self-attention (retrieved 2026-11-07)
- Machine Learning Glossary · Google for Developers · Primary source · Glossary, self-attention (retrieved 2026-11-07)
- [12]
Anthropic's documentation says the newer tokenizer used by its recent Claude models produces approximately 30 percent more tokens from the same input text than earlier models, with the exact increase depending on the content. confirmedas of 2026-11-14
- Token counting (Claude API documentation) · Anthropic · Primary source · Token counting, tokenizer note (retrieved 2026-11-14)
- [13]
Google says all input to and output from the Gemini API is tokenized, including text, images and other non-text inputs. confirmedas of 2026-11-14
- Understand and count tokens (Gemini API) · Google AI for Developers · Primary source · Count tokens (retrieved 2026-11-14)
- [14]
Google's Gemini documentation says images up to 384 pixels on both sides count as 258 tokens, larger images are split into 768x768-pixel tiles of 258 tokens each, and audio counts as 32 tokens per second. confirmedas of 2026-11-14
- Understand and count tokens (Gemini API) · Google AI for Developers · Primary source · Multimodal tokens (retrieved 2026-11-14)
- Understand and count tokens (Gemini API) · Google AI for Developers · Primary source · Multimodal tokens, audio (retrieved 2026-11-14)
- [15]
Google says the cost of a call to the Gemini API is determined in part by the number of input and output tokens. confirmedas of 2026-11-14
- Understand and count tokens (Gemini API) · Google AI for Developers · Primary source · About tokens (retrieved 2026-11-14)
- [16]
Anthropic recommends using its token counting API to estimate token usage before sending a request, and says the count is an estimate. confirmedas of 2026-11-14
- Context windows (Claude API documentation) · Anthropic · Primary source · Context window overflow behavior (retrieved 2026-11-14)
- Token counting (Claude API documentation) · Anthropic · Primary source · Token counting (retrieved 2026-11-14)
- [17]
Anthropic says the context window is different from the large body of data a model was trained on and works more like the model's working memory. confirmedas of 2026-11-14
- Context windows (Claude API documentation) · Anthropic · Primary source · How the context window works (retrieved 2026-11-14)
- Context windows (Claude API documentation) · Anthropic · Primary source · How the context window works (retrieved 2026-11-14)
- [18]
Anthropic says that when a model uses extended thinking, the thinking tokens also count toward the context window limit. confirmedas of 2026-11-14
- Context windows (Claude API documentation) · Anthropic · Primary source · The context window with thinking (retrieved 2026-11-14)
- [19]
Anthropic says cached prompt prefixes still occupy the context window, because prompt caching changes what is paid for those tokens, not whether they count. confirmedas of 2026-11-14
- Context windows (Claude API documentation) · Anthropic · Primary source · Manage context with compaction (retrieved 2026-11-14)
- [20]
Google estimates that 1 million tokens is about 50,000 lines of code or eight average-length English novels. confirmedas of 2026-11-14
- Long context (Gemini API) · Google AI for Developers · Primary source · Getting started with long context (retrieved 2026-11-14)
- Long context (Gemini API) · Google AI for Developers · Primary source · Getting started with long context (retrieved 2026-11-14)
- [21]
Google says smaller context windows often force strategies such as dropping old messages, summarizing content, using retrieval-augmented generation with vector databases, or filtering prompts to save tokens. confirmedas of 2026-11-14
- Long context (Gemini API) · Google AI for Developers · Primary source · Getting started with long context (retrieved 2026-11-14)
- [22]
Anthropic says chat interfaces such as claude.ai can manage the context window on a rolling basis, and its server-side compaction summarizes earlier parts of a conversation so it can continue past the context window limit. confirmedas of 2026-11-14
- Context windows (Claude API documentation) · Anthropic · Primary source · How the context window works, note 1 (retrieved 2026-11-14)
- Context windows (Claude API documentation) · Anthropic · Primary source · Manage context with compaction (retrieved 2026-11-14)
- [23]
A 2023 study found that language models often performed best when relevant information was at the beginning or end of a long input and significantly worse when it was in the middle, even for models built for long contexts. confirmedas of 2023-07-06
- Lost in the Middle: How Language Models Use Long Contexts · arXiv · Primary source · 2023-07-06 · Abstract (retrieved 2026-11-14)
- [24]
Google says Gemini models score highly when retrieving a single piece of information from a long context but do not perform with the same accuracy when looking for multiple pieces of information. confirmedas of 2026-11-14
- Long context (Gemini API) · Google AI for Developers · Primary source · Long context limitations (retrieved 2026-11-14)
- [25]
Because self-attention makes every token in the context learn the relevance of every other token, its cost grows with the square of the number of tokens. confirmedas of 2026-11-07
- LLMs: What's a large language model? (Machine Learning Crash Course) · Google for Developers · Primary source · LLMs: What's a large language model?, Big O for LLMs (retrieved 2026-11-07)
Revision history (1)
- Page created.
Created Nov 14, 2026. Last reviewed by an editor on Nov 14, 2026. Next scheduled review: May 14, 2027.
Cite this page
"Tokens and context windows: how AI models read and remember." ContentLora, updated Nov 14, 2026. https://contentlora.com/explain/ai-tokens-and-context-windows-explained
Spotted an error? Suggest a correction or emailcorrections@contentlora.com.