Context length (also called the context window or context size) is one of the most important specifications of any large language model (LLM). It sets how much text a model can read and reason over at once, and in 2026 it has become a headline number that vendors compete on directly. Two years ago a 32,000-token window was considered generous. Today a 1 million token context window is the standard for flagship models from OpenAI, Google, Anthropic and Meta, and it has reached budget models too: Claude Haiku 5.5 and GPT-6 Luna both offer it. Meta’s open-weight Llama 4 Scout still advertises the largest window at 10 million tokens.
This guide explains what context length in an LLM actually is, how it differs from a context window, why it matters for accuracy and cost, which models offer the largest context windows right now, and the gap between the numbers vendors advertise and the context a model can genuinely use. Everything below reflects the state of the field as of November 2026.
What is context length in an LLM?
Context length is the maximum number of tokens that an LLM can process in a single input sequence. Tokens are the basic units of text that the model understands, which can be words, subwords, or even characters. As a rough rule of thumb in English, one token is about four characters, and 1,000 tokens is roughly 750 words. So a model with a 1 million token context window can hold around 750,000 words, or about 1,500 pages of text, in view at one time.
That rule of thumb varies by model, because every model family uses its own tokenizer. Anthropic notes that Claude Haiku 5.5 counts the same text as roughly 30 percent more tokens than Claude Haiku 4.5, so two windows of “1 million tokens” do not always hold the same amount of text.
In plain terms, context length is the model’s attention span. It determines how much information the model can consider at once when it generates a response. Most current models handle between 128,000 and about 1 million tokens, and the outliers reach 10 million. That difference shapes what each model is good at.
When the combined input exceeds the model’s limit, you hit the context length limit. At that point the model either refuses the request or silently drops the oldest tokens, which is why long chat sessions, large document uploads and local models in tools like LM Studio can start to feel forgetful. We cover what to do about that in the FAQ below.
Context length vs. context window: is there a difference?
The terms context length, context window, and context size are used interchangeably by almost everyone in practice, including model providers. If you see any of them, you can safely assume they refer to the same idea: how many tokens the model can take in at once.
If you want to be precise, there is a subtle distinction. The context window is the model’s fixed maximum capacity, a property of how it was built and trained (for example, 1,048,576 tokens for Gemini 4 Argon). The context length is how much of that window a particular input actually occupies. A 40,000-token document has a context length of 40,000 tokens, well within a 1 million token context window. Think of the window as the size of the desk and the length as how much paper you have spread across it right now.
One detail matters in practice: the window is usually shared by input and output. OpenAI’s GPT-6 Astra has a 1,050,000-token context window but accepts at most 922,000 input tokens, which leaves room for its answer. Google describes Gemini 4 Argon’s window as one unified limit for input and output. Max output tokens is a separate, smaller cap on how long a single reply can be.
How context length is measured: the 2026 taxonomy
Context length is measured in tokens, and the goalposts have moved by orders of magnitude. In 2023, 32,000 tokens counted as long. Here is how the tiers break down in November 2026, with a rough page count at about 500 words per page:
- Short context (under 32k tokens, up to about 50 pages): Now mostly the domain of on-device and edge models such as Gemini Nano and small open models, tuned for latency and battery life on phones and laptops. Local tools often load models with a short window by default to save memory.
- Medium context (128k to 256k tokens, about 190 to 380 pages): The comfortable zone for cost-sensitive chatbots and enterprise Retrieval-Augmented Generation (RAG). Models like Mistral Large 3 (256k) sit here, along with many open-weight models you run yourself.
- Long context (400k to 1M tokens, about 600 to 1,500 pages): The new mainstream, for flagship and budget models alike. GPT-6, Gemini 4 Argon, the whole Claude 5.5 family, DeepSeek V4 Pro, Qwen3.7-Max, Kimi K3 and Meta’s Muse Wonder all offer around 1 million tokens, and xAI’s Grok 4.7 offers 500k. That is enough for large codebases, long videos, or a stack of contracts in a single pass.
- Ultra-long context (10M+ tokens, about 15,000 pages): The frontier of near-infinite memory. Meta’s Llama 4 Scout advertises 10 million tokens, enough in principle to ingest entire corporate archives, years of records, or a full legal discovery set at once.
Why is context length important?
Context length shapes the performance and usefulness of an LLM in three connected ways: the complexity of input it can handle, the memory and coherence it can maintain, and the accuracy it delivers over long inputs.
Complexity of input
A larger context window lets a model handle more detailed and complex inputs. A model with a 1 million token window can process the equivalent of roughly 1,500 pages of text, or an entire mid-sized software repository, in one pass. Llama 4 Scout’s 10 million token window pushes that to around 15,000 pages. This matters for tasks like summarizing whole books, analyzing years of financial records, or reviewing a full codebase at once. Without enough context length, the model misses information that sits outside its window, which leads to incomplete or inaccurate answers.
Memory and coherence
LLMs are stateless: they do not inherently remember past interactions. The context window is the model’s working memory, so it determines how much of the earlier conversation or task the model can recall. This is critical for AI agents. An AI software engineer working on a feature needs to remember the original requirements, the architectural constraints agreed earlier, and the variable names changed an hour ago. An agent limited to 128k tokens starts to forget as the task grows and needs constant re-prompting. A 1M token window keeps the project state coherent so that the fiftieth turn is as informed as the first.
Accuracy and performance
The relationship between context length and accuracy is not linear. More tokens give the model more to work with, but they also introduce noise. This is the phenomenon of attention dilution. The hard problem in 2026 is no longer raw capacity but effective context length: it is easy to build a model that accepts 10 million tokens, and much harder to ensure it can find one specific fact in that haystack without hallucinating or slowing to a crawl. The industry has moved from celebrating input capacity to scrutinizing reasoning over context, which we look at in detail below.
LLM context length comparison: popular models in 2026
Different LLMs offer different context windows, but the spread has narrowed sharply. The table below compares the leading models available in November 2026, sorted from the largest context window down. Figures come from the vendors’ own documentation where available, checked on 17 November 2026. Max output is listed separately, because on most models it comes out of the same window.
| Model | Context window (tokens) | Max output (tokens) | Released | Open weights | Best suited for |
|---|---|---|---|---|---|
| Llama 4 Scout (Meta) | 10,000,000 | Not stated | Apr 2025 | Yes | Massive archival analysis, whole-repository and whole-book summarization |
| GPT-6 Astra (OpenAI) | 1,050,000 (max 922,000 input) | 128,000 | Sep 2026 | No | Hardest reasoning, coding, computer use and research |
| GPT-6 Luna (OpenAI) | 1,050,000 (max 922,000 input) | 128,000 | 2026 | No | High-volume, low-cost tasks |
| Gemini 4 Argon (Google) | 1,048,576 (shared by input and output) | 65,536 (up to 1M with long decode) | Oct 2026 | No | Long-horizon coding and agents, native video and audio reasoning |
| Qwen3.7-Max (Alibaba) | 1,048,576 | Not stated | May 2026 | No | Long-running agent tasks |
| Kimi K3 (Moonshot) | 1,048,576 | 131,072 (default) | Jul 2026 | Yes | Agentic coding and long-horizon work |
| Claude Fable 5.2 (Anthropic) | 1,000,000 | 128,000 | 2026 | No | Most demanding reasoning and agentic work |
| Claude Opus 5.5 (Anthropic) | 1,000,000 | 128,000 | Sep 2026 | No | Long-running agentic coding and knowledge work |
| Claude Sonnet 5.5 (Anthropic) | 1,000,000 | 128,000 | Sep 2026 | No | Balanced speed and intelligence for coding and agents |
| Claude Haiku 5.5 (Anthropic) | 1,000,000 | 128,000 | Oct 2026 | No | Classification, extraction, routing and subagents |
| DeepSeek V4 Pro (DeepSeek) | 1,000,000 | 384,000 | Aug 2026 | Yes | Cost-efficient reasoning and coding |
| Muse Wonder (Meta) | 1,000,000 | Not stated | Oct 2026 | Not announced | Personal and professional agentic work |
| Mistral Large 4 (Mistral) | 1,000,000 | Not stated | Public preview | Yes | Long-context work with European deployment |
| Grok 4.7 (xAI) | 500,000 | No text output limit | Oct 2026 | No | Coding and agentic tasks |
| Mistral Large 3 (Mistral) | 256,000 | Not stated | Dec 2025 | Yes | Enterprise multilingual and sovereign EU deployments |
Table 1: Leading LLMs by context window, November 2026. Figures are advertised maximums; usable context is typically lower (see the next section).
A few takeaways. Meta’s Llama 4 Scout still holds the headline record at 10 million tokens, which makes it attractive for massive archival work where breadth matters more than deep reasoning. Meta’s newer Muse models stop at 1 million. Among the frontier labs, OpenAI, Google, Anthropic, DeepSeek, Alibaba and Moonshot have all converged on roughly 1 million tokens, so the practical differentiator is now reasoning quality, multimodality, max output, and price rather than raw window size. The biggest change since mid-2026 is that the 1M window has moved down-market: Claude Haiku 5.5 and GPT-6 Luna, both starting at $0.10 per million input tokens, have the same window as their flagship siblings.
The small print matters more than the headline number. OpenAI charges double for GPT-6 input above 272,000 tokens, Claude Haiku 5.5 charges a higher rate above 100,000 tokens, and Gemini 4 Argon shares one 1M budget between your input, its thinking and its answer. Check those limits before you plan a workload around the full window.
For European organizations there are two notes worth flagging. Mistral Large 3 (256k, generally available) and Mistral Large 4 (1M, in public preview) offer open weights and European deployment options, which makes them the natural choice when data residency inside Europe is a hard requirement. Open-weight 1M models such as DeepSeek V4 Pro and Kimi K3 can also be self-hosted in an EU data center, if you have the hardware to run them.
Advertised context window vs. usable context: the effective context problem
The single most important thing to understand about context length in 2026 is that the advertised number is a ceiling, not a promise. Independent testing consistently shows that models start to lose reliability well before their stated limit. The RULER benchmark tested 17 models that all claimed at least 32,000 tokens, and only about half of them performed satisfactorily at that length. Chroma’s context rot study of 18 models, including GPT-4.1, Claude 4 and Gemini 2.5, found the same pattern: performance grows less reliable as the input gets longer, even on simple tasks.
The persistence of lost-in-the-middle
Research continues to validate the lost-in-the-middle effect: LLMs recall information placed at the beginning (primacy) and end (recency) of a long input far better than material buried in the middle. Fill a window with hundreds of pages and the facts in the center are the ones most likely to be missed. This is why simply pasting everything into a huge prompt is rarely the best strategy.
Capacity is not the same as fidelity
Being able to accept 10 million tokens does not guarantee reasoning over them. Simple needle-in-a-haystack tests, like the one in Figure 1, are exactly where RULER found models looking near-perfect while they failed harder tasks at the same length. The lesson is to distinguish context capacity (how much a model accepts) from context fidelity (how well it uses what it accepts).
Retrieval vs. reasoning
A key 2025 finding, reinforced through 2026, is the gap between retrieval (finding a specific fact) and reasoning (combining facts into a conclusion). The paper “Context Length Alone Hurts LLM Performance Despite Perfect Retrieval” showed that even when models retrieve all the relevant evidence perfectly, their performance still drops by 13.9 to 85 percent as the input grows, well within their claimed context length. For tasks that require deep logic across a large corpus, a well-built RAG system that feeds the model only the relevant chunks often beats stuffing everything into a giant context window.
How do you set or configure context length?
Context length is fixed during a model’s design and training, so you cannot expand a model’s window beyond its maximum. What you can control is how much of it you use and how you pay for it. Depending on the interface or API, you typically manage four things:
- Input size: How many tokens you send. Most APIs handle the input context automatically up to the model’s limit and return an error if you exceed it.
- Output size: Providers let you cap generated tokens (for example, OpenAI’s max_output_tokens or Anthropic’s max_tokens parameter). Current OpenAI and Anthropic flagships allow up to 128,000 output tokens, and Gemini 4 Argon can generate up to 1 million tokens minus your input with long decode.
- Context caching: The OpenAI, Anthropic, Google and DeepSeek APIs all support prompt caching, so a large, reused context (such as a long document or system prompt) costs a fraction of the normal input price on repeat calls. This is the main lever for keeping long-context costs manageable.
- Local context length: When you run a model yourself, you choose the window when you load it. In LM Studio this is the Context Length setting in the model’s load options, or lms load <model> –context-length 32768 from the command line. llama.cpp uses –ctx-size and Ollama uses num_ctx. A larger setting reserves more memory for the key-value cache, so raise it only as far as your RAM or VRAM allows, and reload the model after you change it.
A note on cost: increasing context length increases cost roughly in proportion to the tokens processed, and some providers add a surcharge for very long prompts. In November 2026 the input for a single 900,000-token prompt costs about $0.45 on Claude Haiku 5.5, $3.60 on Claude Opus 5.5 and about $18 on GPT-6 Astra, which charges double above 272,000 tokens. That makes context stuffing expensive compared with RAG, where you retrieve and send only the few thousand tokens that actually matter. Our guide to token optimization covers more ways to cut that bill.
How are massive context windows built?
The leap from 128k to millions of tokens was not just a matter of adding hardware. Standard attention has a quadratic cost: doubling the context length quadruples the compute. Overcoming that required real architectural redesign. Three innovations do most of the heavy lifting.
Ring Attention: distributed processing
Ring Attention is arguably the key enabler of the 1M+ token era. Standard self-attention needs the entire key-value (KV) cache to sit in one GPU’s high-bandwidth memory. For a 10 million token sequence that cache would run into terabytes, far beyond a single H100’s 80GB. Ring Attention distributes the sequence across many GPUs arranged in a logical ring. Each GPU computes attention for its local block, then passes its KV block to its neighbor while receiving the next block from its predecessor. Because this communication overlaps with computation, the effective context length scales close to linearly with the number of devices. By late 2025, frameworks like PyTorch had integrated Ring Attention natively into their context-parallel APIs, making the technique standard in training and inference pipelines.
iRoPE: keeping track of position at scale
Llama 4 Scout’s 10 million token reach relies on iRoPE (Interleaved Rotary Positional Embeddings), a variant of standard Rotary Positional Embedding (RoPE). Standard RoPE generalizes poorly far beyond its training length: at millions of tokens the rotation frequencies that encode position blur together (frequency collapse) and the model loses the relative order of tokens. iRoPE interleaves layers that apply RoPE for local order (syntax and grammar) with layers that use no positional encoding for global structure, so the model keeps precise local coherence while still grasping relationships that span the whole input.
Mixture of Experts and dynamic sparsity
Running a dense model, where every parameter fires for every token, over millions of tokens would be far too slow and costly. The field has standardized on Mixture of Experts (MoE) to decouple total model size from active compute. Llama 4 Scout, for instance, has 109 billion total parameters but activates only about 17 billion per token: a router picks the few experts relevant to each token. Newer designs bring the same idea into the attention layer itself. DeepSeek V4 combines token-wise compression with DeepSeek Sparse Attention, and Moonshot’s Kimi K3 uses its own Kimi Delta Attention, both to make a 1M window cheaper to serve. Techniques like cascading KV caches go further, keeping high-attention tokens in fast memory and evicting less relevant ones, so the effective window stays large while the compute footprint stays manageable.
The challenges and limits of large context windows
Beyond the accuracy issues above, two hard limits keep enormous context windows from being a universal answer: latency and cost.
Latency
The time to first token for a prompt that fills a 1M window can be measured in tens of seconds to minutes, even on large GPU clusters, because the model must read the entire input before it can respond. That relegates ultra-long-context jobs to asynchronous, batch-style processing, such as overnight report generation, rather than real-time chat. Users will not wait two minutes for an assistant to read a library before it answers.
Cost
Cost scales with tokens processed. A single fully loaded 1M-token query costs anything from under a dollar to around $20 in input alone, depending on the model, and for high-frequency workloads that is far more expensive than a vector-database RAG approach costing a fraction of a cent per query. For most production systems, the economical pattern is to retrieve the relevant few thousand tokens and reserve the giant window for the rare cases that truly need it.
Practical applications and use cases
The expansion to 1M+ token windows has unlocked categories of work that used to require brittle engineering workarounds.
Vibe coding and repository-scale engineering
Vibe coding, a term that went mainstream in 2025, describes development driven by high-level natural-language intent rather than line-by-line syntax. With a 1M+ token window, a developer can load an entire repository, tens of thousands of lines across hundreds of files, so the model holds the full dependency graph and architectural patterns in active memory and can make coherent, project-wide changes. This is exactly why the 2026 flagships from Anthropic, OpenAI, Google, and xAI all market their coding and agentic strength alongside their window size.
Legal discovery and compliance
The legal sector is a prime beneficiary of very large windows. In litigation, discovery means reviewing huge volumes of documents to find relevant evidence. A model can ingest thousands of emails, contracts, and memos in one pass and answer questions like finding every instance where a topic was discussed in a specific context over a date range. In practice, the strongest legal AI systems use a hybrid approach: retrieval narrows millions of documents down to the most relevant few hundred thousand tokens, and the model reasons over that. This keeps critical evidence from being drowned out by noise while still using the model’s synthesis ability.
Multimodal and video reasoning
Gemini 4 Argon accepts text, images, audio, video, and PDFs natively inside its context window, which enables video reasoning that goes well beyond transcription: summarizing an hour-long recording, locating a specific moment, or comparing what is said against what is shown. As multimodal windows grow, whole recorded meetings, training sessions, and video archives become directly analyzable.
Context length vs. RAG: which should you use?
Because a bigger window is not automatically better, the practical question is when to rely on context length and when to use Retrieval-Augmented Generation (RAG). As a rule of thumb: use a large context window when you need the model to reason across a whole, self-contained input at once (a single contract, one codebase, one long video). Use RAG when you are querying a large, changing, or repetitive knowledge base, when you need low cost per query, or when precision matters more than breadth. Many production systems combine both: RAG selects the relevant material, and a long-context model reasons over it. Deciding what goes into the window at each step is now a discipline of its own, called context engineering. If you want the details, see our explainer on what RAG is and how it works and consider which pattern fits your data.
Conclusion
Context length is a fundamental property of LLMs that shapes how much they can read, remember, and reason over at once. In 2026 the numbers are extraordinary, with 1 million tokens now standard from flagship to budget models and 10 million tokens available at the open-weight frontier, but the story has matured. The frontier is no longer just the size of the window; it is how much of that window a model can actually use well. Larger context lengths unlock genuinely new capabilities in coding, legal analysis, and multimodal reasoning, while also demanding more compute, higher cost, and smarter architecture to keep accuracy high.
The practical takeaway is to match the tool to the task: use a large context window when you need whole-input reasoning, lean on RAG when precision and cost matter, and always test with your own data rather than trusting the advertised number. Used well, context length is one of the most powerful levers you have for getting real value from LLMs.
Want to put this into practice? If you are exploring how AI and LLMs can make your organization more efficient, get in touch with the AI experts at DataNorth and book an AI consultancy appointment. We can help you decide between long-context and RAG approaches, accelerate data processing, and turn these capabilities into results.
Frequently asked questions (FAQ)
What is context length in an LLM?
Context length is the maximum number of tokens (words, subwords, or characters) a large language model can process in a single input. It covers everything you send at once: your prompt, any documents, and the earlier conversation. A larger context length lets the model consider more information before it answers.
What is the difference between context length and context window?
In everyday use they mean the same thing. If you want to be precise, the context window is the model’s fixed maximum capacity, while context length is how much of that window a specific input actually uses. A 40,000-token document has a context length of 40,000 tokens inside, say, a 1 million token context window.
What is the current context length range that modern AI models can process?
Most modern AI models process between 128,000 tokens and about 1 million tokens. In November 2026 the 1 million token tier, roughly 750,000 words or 1,500 pages, includes GPT-6, Gemini 4 Argon, all Claude 5.5 models, DeepSeek V4 Pro and Kimi K3. Meta’s Llama 4 Scout is the outlier at 10 million tokens.
Which LLM has the largest context window in 2026?
Meta’s Llama 4 Scout has the largest advertised context window at 10 million tokens, with open weights. Among hosted models, GPT-6 Astra (1,050,000 tokens), Gemini 4 Argon (1,048,576), Claude Opus 5.5, DeepSeek V4 Pro and Qwen3.7-Max lead at around 1 million. The largest advertised window is not always the most reliable in practice.
What does “context length limit reached” mean and what can I do about it?
It means your input plus the conversation no longer fits in the model’s context window. It is common in long chats and in local tools like LM Studio, which can load a model with a smaller window than it supports. Raise the context length setting if your memory allows, start a fresh session, trim earlier messages, or use RAG.
Does a bigger context window always mean better answers?
No. Research such as the RULER benchmark shows that most models lose accuracy well before their advertised limit, and models tend to miss information buried in the middle of a long input (the lost-in-the-middle effect). For many tasks, a focused RAG pipeline that supplies only the relevant text produces more accurate answers than filling a huge window with everything.
How much does a large context window cost?
Cost scales with the tokens processed. Processing a full 1 million token prompt on a high-end model can cost several dollars per query, so large windows are best reserved for tasks that genuinely need them. Context caching and RAG are the main techniques for keeping long-context costs under control.