Skip to main content

Context Window Calculator

Paste your content below. We estimate the token count and show you exactly which current models can hold it in one call — Claude, GPT-5.4, and Gemini 3.1 Pro — plus how many chunks you need if none of them can.

TL;DR

  • Claude Opus 4.8, Sonnet 5, Fable 5, and Gemini 3.1 Pro all ship a 1M-token context window; Haiku 4.5 caps at 200K and GPT-5.4 at 272K on its standard tier
  • Context window (input capacity) and max output tokens are two separate limits, not one — check both before you plan a workload
  • ~1.35 tokens per word for prose is a reasonable estimate; code runs closer to 1.9 tokens per word
  • Content that exceeds every model's window needs chunking or a RAG (retrieval) architecture — not a bigger model
0 words0 tokens1.35 for prose / natural language)

Paste content or enter a word count above to see which models can fit it.

How We Estimate Tokens

We convert your word count into an estimated token count using a fixed ratio per content type: 1.35 tokens per word for prose, 1.55 for mixed documentation, and 1.9 for source code. These numbers come from Anthropic's published guidance that a token is roughly 3.5-4 characters of English text, cross-checked against sample counts from real prose, Markdown docs, and TypeScript/Python source files.

This is a heuristic, not a tokenizer. Word-based estimates land within about 10-15% of a real count for plain English prose. They drift further on non-English text, heavily formatted content, or code with long identifier names — the exact opposite direction of what you might expect, since code often tokenizes into more pieces per word than prose does, not fewer. If you are about to run a production job against a hard token budget, count exactly with the provider's token-counting endpoint rather than trusting this estimate to the token.

On the results side, each model's bar reflects context window only — the maximum input the model can read. We do not fold in output tokens, because current providers meter them as a separate cap (see the table below). The reserve slider subtracts a flat percentage off the top of each window to leave room for your system prompt, tool definitions, and conversation history, which otherwise silently eat into the same budget as your pasted content.

  • Data as of: 2026-07-13
  • Estimation method: word count × fixed tokens-per-word ratio, by content type
  • Context window figures: provider-published model catalogs
  • Not counted toward the window: max output tokens (tracked separately per model)

Context Window Sizes by Model

ModelProviderContext windowMax outputNote
Claude Haiku 4.5Anthropic200,000 tokens64,000 tokens
GPT-5.4OpenAI272,000 tokens128,000 tokensStandard tier — a separate 1M-token experimental mode exists but is not generally available
Claude Sonnet 5Anthropic1,000,000 tokens128,000 tokens
Claude Opus 4.8Anthropic1,000,000 tokens128,000 tokens
Gemini 3.1 ProGoogle1,000,000 tokens64,000 tokens
Claude Fable 5Anthropic1,000,000 tokens128,000 tokensAnthropic’s most capable widely-released model — premium pricing

Four of the six models above ship a 1,000,000-token context window as of 2026-07-13— the gap that mattered a year ago (1M vs. 128-200K) has mostly closed at the frontier tier. Haiku 4.5 and GPT-5.4's standard tier are the exceptions, and the reason we did not just build a "does it fit in 1M" checker: for anyone weighing a cheaper, faster model against a frontier one, that gap is exactly the tradeoff worth seeing.

Real-World Content Sizes

Token counts are abstract until you tie them to something concrete. Here is roughly how common content volumes translate, using the same estimation method as the checker above:

Content~Words~TokensFits in
A 5-page PDF report2,5003,875Claude Haiku 4.5
One chapter of a novel6,0008,100Claude Haiku 4.5
A 1-hour podcast transcript9,00012,150Claude Haiku 4.5
A full novel (average length)90,000121,500Claude Haiku 4.5
A 10,000-line codebase70,000133,000Claude Haiku 4.5
500-message Slack channel export40,00062,000Claude Haiku 4.5
A 300-page legal contract150,000232,500Claude Sonnet 5
A 50,000-line codebase (mid-size repo)350,000665,000Claude Sonnet 5

A useful reference point: a 300-page legal contract lands around 200K tokens, which already exceeds Haiku 4.5's window at a 15% reserve. A mid-size 50,000-line codebase pushes past even GPT-5.4's standard 272K window. This is the practical gap between "the model supports long context" and "your document actually fits" — worth checking before you architect a pipeline around one call.

Long Context vs. RAG: Which One Do You Need

A bigger window is not automatically the right answer. Independent long-context benchmarks — tests like MRCR (multi-round coreference resolution) that measure whether a model can actually retrieve a specific fact buried deep in a huge prompt — consistently show recall degrading as you fill more of a window, even on models that technically support 1M tokens. Stuffing 900K tokens into a 1M window to avoid building retrieval usually costs you accuracy, not just money.

When long context wins

Use a single large prompt when the content is bounded and mostly static within a session, and when the model genuinely needs to reason across the whole thing at once — a contract you want cross-referenced clause by clause, a codebase you want refactored with full awareness of every call site, a research paper you want summarized alongside its own citations. If it fits with room to spare (see the checker above), long context is simpler to build and debug than a retrieval pipeline.

When RAG wins

Retrieval-augmented generation — indexing your content into a vector store and pulling only the relevant passages into each prompt — is the better call once your corpus keeps growing past any single context window, or once most individual queries only need a small slice of a much larger knowledge base. A support knowledge base with 10,000 articles does not need all 10,000 in every prompt; it needs the 3-5 that answer this specific question. RAG also keeps your per-request token cost flat as the corpus grows, where long context scales cost with every document you add.

A middle path: chunk and carry state

For a one-off document that exceeds every window — the "nothing fits" case above — chunking is often simpler than standing up a retrieval pipeline for a single job. Split the content at natural boundaries (chapters, sections, file boundaries), process each chunk with the previous chunk's summary carried forward as context, and merge the results at the end. It is more sequential calls and more orchestration code than one long-context request, but far less infrastructure than a vector database for something you will only process once.

Related tools and guides on OpenAI Tools Hub

J

Jim Liu

Builds and ships AI tooling, and writes token-budgeting and context-management guidance for teams running production LLM pipelines. Publishes tools and analysis at OpenAI Tools Hub.

Frequently Asked Questions

What is a context window in an LLM?

A context window is the maximum number of tokens a model can read as input in a single request. It is separate from the max output tokens the model can generate in its response — Claude Opus 4.8, for example, has a 1,000,000-token context window and a 128,000-token output cap, so it can read up to 1M tokens of input but still write at most 128K tokens back.

What is the difference between a context window and a token limit?

"Token limit" is used loosely for two different things: the context window (how much input the model can read) and the max output tokens (how much it can write per response). They are set independently — a model can have a huge context window and a modest output cap, like Gemini 3.1 Pro’s 1M-token context paired with a 64K output cap.

How many words is 200,000 tokens?

Roughly 140,000-150,000 words of plain English prose, using the ~1.35 tokens-per-word ratio common for natural language. That is close to the full text of a long novel. Code or dense technical text token-inflates faster, so the same 200K tokens might only hold about 105,000 words of source code.

Does a bigger context window always mean better answers?

No. Models show measurable recall degradation as you fill more of a large context window — a fact independently benchmarked as MRCR (multi-round coreference resolution) and similar long-context tests. Cramming 900K tokens into a 1M window to avoid retrieval design usually produces worse answers than a well-scoped 50K-token prompt plus a retrieval step. Use the largest window you need, not the largest window available.

Should I use long context or RAG for a large document set?

Long context (pasting everything into one prompt) works well for a single document or a bounded set you need the model to reason across holistically — a contract, a codebase, a research paper. RAG (retrieval-augmented generation) — indexing content and retrieving only the relevant passages per query — wins once your corpus regularly exceeds the largest context window, or when most queries only need a small slice of a much larger knowledge base. Static, small, single-session material favors long context; growing or per-query-narrow corpora favor RAG.

How accurate is a token-per-word estimate?

It is a heuristic, not an exact count. Word-based estimates are typically within 10-15% of a real tokenizer count for plain English prose, but drift more on code, non-English text, or content with heavy formatting. For an exact count before a production run, use the model provider’s token-counting endpoint (for Claude, the Messages API count_tokens endpoint) rather than a word-count multiplier.

What happens if my content exceeds every model’s context window?

You have two practical options: chunk the content into sequential pieces that each fit within the window (summarizing or carrying forward key state between chunks), or move to a RAG architecture that indexes the full corpus and retrieves only the relevant portion per query. Chunking is simpler to implement; RAG scales better once the corpus keeps growing.

Why do I need to reserve some of the context window instead of using 100% of it?

The context window has to hold your system prompt, tool definitions, conversation history, and any few-shot examples in addition to the document you are analyzing. Filling a window to the exact limit with your document leaves nothing for that overhead, and can also push the model into the degraded-recall zone near full capacity. Reserving 10-20% headroom is a reasonable default for most single-turn tasks; multi-turn agents should reserve more.

Related Tools

Sponsored

Ad served by Adsterra. OpenAIToolsHub is not responsible for advertiser content.