Back to blog

Claude Context Window Size by Model (2026)

Claude context window size for every current model across the API, app and Claude Code, and what happens when it fills.

0 views 7 min read
Share
Claude Context Window Size by Model (2026)

What a context window is

A context window is all the text a model can look at when it writes a response: your prompt, the earlier conversation, any files or tool results, and the reply it is writing. Anthropic describes it as the model's "working memory". It is measured in tokens, not words, and a bigger window does not automatically mean better answers. Anthropic notes that as the token count grows, accuracy and recall can degrade, which it calls context rot, so what you put in the window matters as much as how much room there is.

Claude context window by model

As of 16 October 2026, Anthropic lists these as its current Claude models. Every one of them has a 1M-token context window on the API, and 1M is the default, with no beta header needed:

| Model | Context window (API) | Max output | |---|---|---| | Claude Fable 5.1 | 1M tokens | 128K tokens | | Claude Opus 5.5 | 1M tokens | 128K tokens | | Claude Sonnet 5.5 | 1M tokens | 128K tokens | | Claude Haiku 5.5 | 1M tokens | 128K tokens |

Older models are still available. Claude Sonnet 5, Opus 5 and Opus 4.6 to 4.8 also have 1M, while Claude Haiku 4.5 (a legacy model) has 200K. Anthropic's rough conversion: 1M tokens is about 555,000 words on the current tokenizer, and 200K tokens is about 150,000 words. Haiku 5.5 charges more for prompts over 100,000 tokens; the other current models bill long prompts at the standard rate.

Sources: models overview and context windows, checked 16 October 2026. When a new Claude model launches, update this table.

Context window in the Claude app, the API and Claude Code

The same model can have a different window depending on where you use it.

  • API: the sizes in the table above.
  • Claude app (Pro, Max, Team and Enterprise): Anthropic's support page lists 1M tokens for Fable 5.1, Opus 5.5, Sonnet 5.5 and Haiku 5.5, 500K for several earlier models (Fable 5, Opus 4.6 to 4.8, Sonnet 4.6), and 200K for any model not listed. With code execution turned on, Claude automatically summarizes earlier messages as a conversation nears the limit, and your full chat history is kept. Support page, checked 16 October 2026.
  • Claude Code: the current models run with the 1M window by default. Claude Opus 4.6 and Sonnet 4.6 reach 1M only through their [1m] variants, and some plans need usage credits for that. You can turn 1M off with CLAUDE_CODE_DISABLE_1M_CONTEXT=1, after which default-1M models are treated as having 200K. Claude Code model configuration, checked 16 October 2026.

How to check how much of the window your text uses

Paste your text into the token counter for Claude, GPT and Gemini. It shows a token count for each model, how much of that model's context window the text fills, and what it costs to send once as input. It runs in your browser, so your text is not uploaded.

Be clear about what the counter does for Claude. OpenAI publishes its tokenizers, so GPT counts are exact. Anthropic does not publish a tokenizer that runs in a browser, so the counter's Claude figure is an estimate: the GPT-4o count scaled up by a fixed ratio (about 20%), marked with a "~". Treat it as a planning guide. Anthropic says its newer tokenizer (Claude Opus 4.7 and later) produces roughly 30% more tokens than earlier models for the same text, so recount important prompts against the exact model you will use.

For an exact figure, use Anthropic's own token counting API (POST /v1/messages/count_tokens). It is free to use, subject to rate limits, and Anthropic describes its result as an estimate that can differ by a small amount from the tokens billed. Docs, checked 16 October 2026.

A worked example. The text is the instruction block we use to tell an AI how to turn a rough idea into a finished prompt (the Prompt Builder's rules): 186 words, 1,081 characters. Pasted into the token counter, it gives:

| Model | Tokens | Share of the context window | |---|---|---| | GPT-4o (exact) | 236 | 0.18% of 128K | | Claude Opus 5.5 (estimate) | ~283 | 0.028% of 1M | | Claude Sonnet 5.5 (estimate) | ~283 | 0.028% of 1M | | Claude Haiku 4.5 (estimate) | ~283 | 0.14% of 200K | | Gemini 3.6 Flash (estimate) | ~248 | 0.024% of 1M |

The point of the example: a prompt this size is a rounding error against a 1M window. Context fills up through long conversations, big files and tool output, not through one carefully written prompt.

What happens when the context window fills up

On the API, if your input alone is over the model's window, the request fails with a 400 invalid_request_error ("prompt is too long"). On Claude 4.5 models and newer, if input plus max_tokens would go over the window, the request is accepted and generation stops with stop_reason: "model_context_window_exceeded" when it reaches the limit. For long conversations, Anthropic recommends server-side compaction, which summarizes earlier turns so the conversation can continue; it is in beta for Claude 4.6 and later models. Source: context windows, checked 16 October 2026.

In Claude Code, compaction is built in. By default it compacts when the conversation reaches the model's context limit, and for models with a native 1M window that is at about 967K tokens. You can compact earlier yourself with /compact (for example /compact Focus on code samples and API usage to say what to keep), start fresh with /clear, or set your own threshold with /autocompact (for example /autocompact 500k). Sources: Claude Code model configuration and managing costs, checked 16 October 2026.

How to use less of it

Shorter prompts leave more room. The prompt compressor (our Token Optimizer) rewrites a verbose prompt to use fewer tokens, then counts the tokens before and after. It is our own tool, and the saving depends on the prompt: wordy prompts shrink the most, and a prompt that is already tight may barely change. For the Claude Code side of this, see how to reduce Claude Code token usage.

FAQ

What is the Claude context window?

It is all the text Claude can use when it writes a response: your prompt, the conversation so far, any files and tool results, and the response itself. It is measured in tokens.

How big is the Claude context window?

As of 16 October 2026, Anthropic's current models (Fable 5.1, Opus 5.5, Sonnet 5.5 and Haiku 5.5) each have a 1M-token window on the API. In the Claude app and in Claude Code the size can differ by model and plan, so check the section above.

What happens when the Claude context window is full?

On the API, a request whose input is over the window fails with a "prompt is too long" error, and a response that reaches the limit stops with model_context_window_exceeded. In Claude Code, the conversation is compacted automatically, and in the Claude app with code execution on, earlier messages are summarized.

How do I check how many tokens my text uses in Claude?

Paste it into the token counter for Claude, GPT and Gemini. The Claude figure is an estimate (the GPT-4o count scaled up by a fixed ratio), so use Anthropic's free token counting API when you need an exact number.

Is the Claude token counter free?

Yes. It runs in your browser with no sign-in and no daily limit.

How do I use less of the context window?

Start a fresh conversation for unrelated work, keep prompts and instruction files tight, and compact long sessions. A prompt compressor such as our Token Optimizer can shorten a wordy prompt. For Claude Code specifically, see how to reduce Claude Code token usage.

Found this useful? Share it.

Share