Tokens and Context Windows

What tokens and context windows are, why LLMs have them, and why the context-window limit is the mechanical reason AI search chunks and retrieves your content instead of reading whole pages.

First published: Jul 3, 2026 · Last updated: Jul 19, 2026 · Advanced

A token is the smallest unit of text an LLM processes — roughly 4 characters, or about ¾ of an English word (100 tokens ≈ 60–80 words per Google). Tokenization splits text (and images, audio, video) into these units. A context window is the maximum number of tokens a model can hold at once — input plus output combined — like short-term memory; Google's Gemini can accept up to 1 million tokens. Content outside the window is invisible, not gradually forgotten. This matters for AI search because no full page or site fits in one window, so retrieval systems select and chunk your content before an LLM ever sees it — which is the mechanical reason chunking, passage-level retrieval, and 'keep it clear and self-contained' advice exist. A bigger context window does not mean an AI reads your whole site, and Google says there's no ideal page length and no requirement to fragment content for AI.

TL;DR — A token is the unit an LLMA large language model (LLM) is a deep-learning model trained on massive text corpora to predict the next token and generate human-like text. LLMs use the transformer architecture and power AI search features like Google's AI Overviews (Gemini) and Bing Copilot (GPT-4). processes — a sub-word fragment, ~4 characters, with 100 tokens ≈ 60–80 English words (Google). Tokenization splits all input and output — text, images, audio, video — into tokens; the model’s known set is its vocabulary. A context window is the total token budget shared by input (system prompt + history + retrieved docs + your query) and output (the response) — Google’s analogy is short-term memory. Content outside the window is invisible, not gradually forgotten. Windows scaled from ~2K tokens to 1M+ (Gemini), with a hardware ceiling (“thermal limit” of TPUs). The reason this matters for search: systems manage cost and relevance by selecting and chunkingChunking is splitting a document into smaller passages so AI systems can embed, index, and retrieve the single most relevant piece — not the whole page — in response to a query. It's a foundational step in RAG pipelines and the conceptual cousin of Google's passage ranking. before an LLM sees your content — and “Lost in the Middle” means even what is in the window isn’t used evenly. A bigger window does not mean AI reads your whole site.

What a token actually is

Tokenization maps text into integer token IDs using a model-compatible encoding; token boundaries are not the same as word boundaries. Evidence for this claim OpenAI models process text as tokens, and token boundaries may be whole words or parts of words. Scope: OpenAI tokenization; token counts depend on the model-compatible encoding. Confidence: high · Verified: OpenAI: What are tokens? Context-window sizes are product and model metadata, not a permanent property of all language models. Evidence for this claim Context-window limits are documented per model and can differ across model versions. Scope: OpenAI model metadata; published limits are product-specific and can change. Confidence: high · Verified: OpenAI: Models

Google is blunt about the granularity: “Gemini and other generative AI models process input and output at a granularity called a token.” A token is not a word and not a character — it’s a fragment. As Google’s docs put it, “Long words are broken up into several tokens. The set of all tokens used by the model is called the vocabulary, and the process of splitting text into tokens is called tokenization.”

The citable rule of thumb, straight from Google: “For Gemini models, a token is equivalent to about 4 characters. 100 tokens is equal to about 60-80 English words.” So roughly ¾ of a word per token, on average — but average is doing work there. Punctuation, non-English text, code, and unusual or long words tokenize less efficiently (more tokens per word), which is exactly why counting words is a poor way to estimate token usage.

Tokens also aren’t just text. Google: “All input to and output from the Gemini API is tokenized, including text, image files, and other non-text modalities.” Images, audio, and video frames all become tokens too. Google DeepMind’s engineers describe the context-window measure as “how many tokens — the smallest building blocks, like part of a word, image or video — that the model can process at once.”

What a context window is

A context window is the maximum number of tokens a model can hold and reason over in a single interaction. Google’s framing is deliberately simple: “An analogy for the context window is short term memory.”

The key mechanical point is that it’s one shared budget. Everything competes for the same space:

  • the system prompt (the instructions the application gives the model),
  • the conversation history so far,
  • any retrieved or injected documents (the passages a search/RAGRAG is the retrieve-then-generate pattern behind AI search: the system retrieves relevant passages from an external index at query time, injects them into the model's context, and generates an answer grounded in those sources — without changing the model's weights. system pulled in),
  • your input (the current query), and
  • the model’s own output (the answer it generates).

Google’s Gemini docs describe input and output drawing from one shared pool. That exact accounting isn’t universal, though: other providers publish a separate maximum- output figure alongside the context window rather than treating it as one undivided budget — Anthropic’s model docs, for instance, list a “context window” size and a distinct “max output” cap side by side for each Claude model. Evidence for this claim Context-window limits are documented per model and can differ across model versions. Scope: OpenAI model metadata; published limits are product-specific and can change. Confidence: high · Verified: OpenAI: Models Check the documentation for the specific model and product you’re actually using rather than assuming one formula applies everywhere.

Whatever the exact accounting, once content falls outside the usable window, it isn’t gradually forgotten — it’s simply invisible, as if it never existed, unless a system explicitly summarizes it and re-injects a shorter version, or the product instead rejects, truncates, or compacts the request before the model ever sees it. That “it’s gone, not fading” behavior is the part that trips people up when they assume an AI “remembers” a long conversation the way a person would.

The context window is a shared request budget. Retrieval decides which source passages are worth spending part of it on. Source: Google AI for Developers

A page or corpus contains many possible passages. Retrieval selects the passages most relevant to the current question. Those passages then share a model-specific context budget with system instructions, conversation history, the current query, and an output allowance. A larger window increases capacity, but it does not mean a search system routinely sends a whole page or site to the model.

© Patrick Stox LLC · CC BY 4.0 ·

How big context windows are — and how fast that changed

The scale-up here has been dramatic. Early generative models handled only a couple thousand tokens; the progression ran through roughly 8K, then 32K, then 128K, before the jump Google flags in its docs: “Gemini is the first model capable of accepting 1 million tokens.”

There’s a physical ceiling, though. Google DeepMind pushed to experimental 10-million- token windows, and research scientist Nikolay Savinov — one of the research leads on the long-context project, who originally targeted 128,000 tokens before landing on 1 million — put the limit plainly: “10 million tokens at once is already close to the thermal limit of our Tensor Processing Units.” Bigger context isn’t free — it costs memory, compute, and literally heat. (Google DeepMind’s Denis Teplyashin has described the same cascade from 128K to 512K to 1M to 10M, each step opening new possibilities but running into harder engineering limits; research scientist Machel Reid has described what teams actually do with that space, like feeding an entire codebase or a 45-minute film into a single prompt.)

Two consequences worth internalizing:

  1. The numbers you see are moving targets. “The largest context window” is a figure that keeps changing; don’t hard-code strategy to a specific token count.
  2. Bigger ≠ automatically better. More capacity is not more comprehension — see “Lost in the Middle” below.

What a million tokens actually looks like

Abstract token counts are hard to feel, so Google offers concrete sizing for what 1M tokens can hold:

  • “50,000 lines of code (with the standard 80 characters per line),”
  • “All the text messages you have sent in the last 5 years,”
  • “8 average length English novels,”
  • “Transcripts of over 200 average length podcast episodes.”

That’s genuinely enormous — and it’s exactly why the “so the AI just reads my whole site” assumption feels reasonable and is still wrong. Which brings us to the search angle.

This is the core of it for anyone doing SEO or content. No full page — and certainly no full site — is reliably handed to a model whole in a search scenario. Even when a page fits technically, feeding all of it may be uneconomical or irrelevant to the query. That is why retrieval systems — AI OverviewsAI Overviews are the AI-generated summary box Google shows above or within its regular search results, written by Gemini models from pages retrieved out of Google's normal Search index. It's a Search feature, not a separate platform or index., Copilot, RAG pipelines, chatbots with browsing — select, chunk, and pass only some of a page’s content to the model. (No search vendor publishes exactly what it retrieves per query, so this is inference from how retrieval architectures work generally and from public statements like the ones below — not a claim that every AI searchAI search uses large language models and retrieval-augmented generation (RAG) to synthesize an answer from multiple sources rather than returning a ranked list of links. Examples include Google AI Overviews, ChatGPT Search, and Perplexity. product behaves identically.)

The token/context-window limit is the mechanical reason behind a whole stack of AI- search behavior you already know about on this site:

  • It’s why chunkingChunking is splitting a document into smaller passages so AI systems can embed, index, and retrieve the single most relevant piece — not the whole page — in response to a query. It's a foundational step in RAG pipelines and the conceptual cousin of Google's passage ranking. exists — content gets split into retrievable passages because the whole thing won’t fit, and Microsoft’s own Azure guidance says partitioning large documents into smaller chunks “can help you stay under the maximum token input limits of chat completion and embeddingEmbeddings are dense numerical vectors — lists of floating-point numbers — that represent the meaning of text in a high-dimensional space. Semantically similar content lands close together, so search and AI systems can match by meaning, not just keywords. models.”
  • It’s why retrieval (the “R” in RAG) has to pick a handful of passages before generation — the model can only be handed what fits in its budget.
  • It’s why embedding models have their own token caps (many top out around a few thousand tokens per input), so long passages have to be split before they’re even turned into vectors.

The industry’s own framing of the problem is explicit. The llms.txtllms.txt is a proposed (not adopted) Markdown file at /llms.txt that gives AI systems a curated map of a site's most important pages. Proposed by Jeremy Howard in 2024, it's read mostly by coding agents like Claude Code — not search crawlers — and Google ignores it. spec opens with: “Large language models increasingly rely on website information, but face a critical limitation: context windows are too small to handle most websites in their entirety.” That’s the whole motivation for the format — even if, as I’ll cover in the myths section, Google’s John Mueller has called llms.txtllms.txt is a proposed (not adopted) Markdown file at /llms.txt that gives AI systems a curated map of a site's most important pages. Proposed by Jeremy Howard in 2024, it's read mostly by coding agents like Claude Code — not search crawlers — and Google ignores it. at best a token-saving “crutch” for coding tools, not a search-visibility mechanism.

”Lost in the Middle” — even what’s in the window isn’t used evenly

Here’s the subtler point. Getting your content into the window isn’t the finish line. The Stanford “Lost in the Middle” study (Liu et al., 2023) foundA 302 (\"Found\") is a temporary redirect: it forwards users to a new URL while telling search engines the original URL should stay in the index. It's a weak canonicalization signal, not the zero-equity dead end of SEO folklore. that on the language models and tasks they tested, models used information at the start and end of their context far better than information buried in the middle. That’s a position effect measured on 2023-era models — not proof every current model always ignores the middle — but it’s held up as a general caution: stuffing more tokens in doesn’t guarantee better answers, and content that leads with its point survives both retrieval and in-context attention better than content that buries it.

The economics: why AI systems are selective on purpose

There’s a business-model reason retrieval systems chunk aggressively rather than feed whole pages. Google notes that “when billing is enabled, the cost of a call to the Gemini API is determined in part by the number of input and output tokens” — and output tokens typically cost several times more than input tokens. Tokens are literally metered. That gives AI systems a strong economic incentive to retrieve and pass only what’s necessary, which reinforces the same conclusion from a different direction: selective, passage-level retrieval isn’t a temporary limitation to wait out — it’s how these systems are designed to work.

Common myths, debunked

  • “A 1-million-token context window means the AI reads my whole website at once.” No. In a search or RAG scenario, retrieval still selects and chunks content before it ever reaches the model’s window. A huge window changes what’s possible in principle, not what a search engine or AI Overview actually feeds itself per query. Google’s line is directly on point: “There’s no ideal page length, and in the end, make pages for your audience, not just for generative AI searchAI search uses large language models and retrieval-augmented generation (RAG) to synthesize an answer from multiple sources rather than returning a ranked list of links. Examples include Google AI Overviews, ChatGPT Search, and Perplexity..”

  • “I need to write in exactly 200-word, token-sized chunks.” No. Google: “There’s no requirement to break your content into tiny pieces for AI to better understand it.” Chunking happens on the system side; your job is clear, well- structured content, not manual token accounting.

  • “More tokens = a smarter model / better answers.” No. A larger window increases capacity, not comprehension — and “Lost in the Middle” shows models use the start and end of their context better than the middle. Bigger isn’t automatically better.

  • “Tokens = words, so I can just count words to estimate usage.” Roughly, but not reliably. 100 tokens ≈ 60–80 English words is Google’s average, but punctuation, code, non-English text, and unusual words tokenize less efficiently — which matters when you’re estimating cost or budget.

  • “llms.txt solves the context-window problem for my site.” The problem is real — it’s the spec’s own stated motivation — but Google doesn’t use llms.txt for search, and Mueller has framed it as a token-saving crutch for AI coding tools, not an SEO fix. The mitigations that actually matter are the same fundamentals: be crawlable and indexed, and write clear, retrieval-friendly content.

What this means for content and SEO

Strip the jargon and the takeaways are concrete — and they’re the same discipline that shows up across this cluster:

  • Front-load the answer. Both retrieval and in-context attention favor the start (and end) of what a model sees. Lead with your point.
  • Keep sections self-contained. Because a passage may be pulled out of your page and handed to a model on its own, it should stand on its own. This is the same logic behind good H2/H3 structure and clear topic sentences.
  • Don’t obsess over manual chunking. No ideal page length, no requirement to fragment. Write for humans; the system chunks.
  • “Bigger context window” ≠ “AI reads my whole site.” Optimize for being found and selected, not for being ingested whole.

Tokens and context windowsA token is the smallest unit of text (or image/audio/video) an LLM processes — roughly 4 characters, or about ¾ of an English word. A context window is the maximum number of tokens (input plus output) a model can hold at once, like its short-term memory. are the low-level plumbing under most of this cluster: they’re the reason groundingGrounding is anchoring an AI model's answer to source documents it retrieves at the moment you ask — not to the patterns frozen into its weights during training. Retrieval-Augmented Generation (RAG) is the most common way to do it. and retrieval have to select passages, the reason chunking prepares text the way it does, the constraint embeddingsEmbeddings are dense numerical vectors — lists of floating-point numbers — that represent the meaning of text in a high-dimensional space. Semantically similar content lands close together, so search and AI systems can match by meaning, not just keywords. and semantic and vector searchVector search finds content by comparing the meaning of a query against stored content as numerical vectors, retrieving the closest ones in a high-dimensional embedding space. At scale it uses approximate nearest neighbor (ANN) algorithms — not exact comparison — to search billions of vectors in milliseconds. work within, and the limit passage rankingPassage ranking is a Google AI system that scores individual sections ('passages') of a page so a single page can earn multiple relevance scores for different queries. Google still indexes whole pages — only the ranking changed. exists to work around. And they sit right next to the model’s other hard boundary — its knowledge cutoffA knowledge cutoff (or training data cutoff) is the date after which an LLM was no longer trained on new data. The model has no awareness of anything that happened later — unless the system bolts on live retrieval (RAG/web search) to fetch it at query time. — as one of the core limitations of any LLM.

Add an expert note

Pin an expert quote

New person? Create their unclaimed profile at /admin/experts/ → Pin a quote first.