::calculator · Find the smallest model that holds your input in one shot.
Context Window Fit Calculator
::inputs
Total character count of the input you want the model to read in one shot.
Headroom multiplier for system prompt, output tokens, and intermediate reasoning.
::result
Input tokens (estimate)
12,500 tokens
Required context window (with reasoning room)
—
::how this calculates
Token count is estimated by dividing character length by 4, the standard rule-of-thumb ratio for English prose. The required context is that token estimate multiplied by a reasoning-room factor: 1.2x for minimal overhead (short reply, lean prompt) or 1.5x for generous overhead (long output, deep reasoning, or tool-call chains). Compare the required context against published model windows — Claude 3.5 Sonnet at 200K, GPT-4o at 128K, Gemini 1.5 Pro up to 2M — to find the smallest window that fits without truncation.
::worked examples
Short product spec (8K chars, minimal headroom)
Roughly 2,000 input tokens with 1.2x headroom = ~2,400 tokens required. Fits in every modern model. Cheapest tier wins: GPT-4o mini (128K, $0.15/M input) or Claude 3.5 Haiku (200K, $0.80/M input) are overkill on window but right on price. No reason to reach for a long-context model.
Medium codebase digest (60K chars, generous headroom)
About 15,000 input tokens with 1.5x headroom = ~22,500 tokens required. Comfortably inside GPT-4o ($2.50/M input, 128K window) and Claude 3.5 Sonnet ($3/M input, 200K window). Either works; Sonnet has more room for follow-up turns if the workflow is multi-step.
Legal contract bundle (500K chars, generous headroom)
Roughly 125,000 input tokens with 1.5x headroom = ~187,500 tokens required. Squeezes into Claude 3.5 Sonnet's 200K window with thin headroom. Gemini 1.5 Pro (up to 2M window, $1.25/M input below 128K and $2.50/M above) is the safer pick — more breathing room, lower per-token cost at this scale.
Full-book research synthesis (1.6M chars, generous headroom)
About 400,000 input tokens with 1.5x headroom = ~600,000 tokens required. Out of reach for Claude 3.5 Sonnet (200K) and GPT-4o (128K). Gemini 1.5 Pro's 2M window is the only single-shot option ($2.50-$5/M input above 128K). Consider whether a RAG pipeline against a cheaper model would beat the per-call cost — at this size you're paying for the whole window every call.
::what this does NOT capture
- ○4 characters per token is an English-prose rule-of-thumb. Code, JSON, and non-Latin scripts can skew the ratio by 30 percent or more — use the actual tokenizer for precise counts.
- ○Reasoning-room multipliers (1.2x minimal, 1.5x generous) are heuristics. Agentic workflows with tool calls or chain-of-thought reasoning often need 2x-3x.
- ○Model windows are sticker spec, not effective spec — many models degrade in recall and reasoning quality well before the published limit (the 'lost in the middle' effect).
- ○Pricing reflects June 2026 list rates and excludes volume discounts, batch APIs, cached input pricing, and enterprise contracts that can cut effective cost 40-90 percent.
- ○Window fit is a necessary filter, not a quality filter. The cheapest model that holds your input may not produce the best output for your task.
- ○Gemini 1.5 Pro has tiered pricing that crosses at 128K input tokens; the lower tier ($1.25/M) does not apply once you exceed that threshold.
- ○Output tokens are billed separately and at a higher rate than input on every major provider — long-output workloads change the cost calculus more than window size does.