Skip to content

LLM Context Window Calculator

Developer Tools•Client-Side & Private

Plan how a prompt fits a model’s context window — system prompt, history, RAG chunks, tools and output in a budget bar, with cost per request and month.

Tool workspace
Estimates, never billing records. Token counts from pasted text are heuristic (~4 characters per token — use the LLM Token Counter for exact GPT counts). Prices are public list prices as of 18 Nov 2026; providers reprice quarterly, so check the provider's pricing page before budgeting.

200k standard; 1M via beta header. Input $3.00/1M · Output $15.00/1M.

System prompt ≈ 28 tokens.

Context budget — 20,928 / 200,000 tokens (10.5%)179,072 free
System prompt: 28 (0.0%)Conversation history: 9,600 (4.8%)RAG chunks: 4,800 (2.4%)Tool definitions: 2,500 (1.3%)Reserved output: 4,000 (2.0%)
Input tokens / request
16,928
Total incl. output
20,928
Cost / request
$0.1108
Cost / month (200/day)
$664.70

Pricing table — public list prices, as of 18 Nov 2026

ModelContextInput / 1MOutput / 1M
GPT-5 (OpenAI)400,000$1.25$10.00
GPT-5 mini (OpenAI)400,000$0.25$2.00
GPT-4o (OpenAI)128,000$2.50$10.00
Claude Sonnet 4.5 (Anthropic)200,000$3.00$15.00
Claude Opus 4.1 (Anthropic)200,000$15.00$75.00
Claude Haiku 4.5 (Anthropic)200,000$1.00$5.00
Gemini 2.5 Pro (Google)1,048,576$1.25$10.00
Gemini 2.5 Flash (Google)1,048,576$0.30$2.50
Llama 4 Scout (Meta)10,000,000$0.11$0.34
DeepSeek V3.2 (DeepSeek)128,000$0.27$1.10
DeepSeek R1 (DeepSeek)64,000$0.55$2.19

Prices are approximate list prices and change quarterly; Gemini Pro prices rise above 200k tokens, DeepSeek and Llama figures are hosted-API list prices. Always confirm on the provider's pricing page before budgeting.

Loading tool controls…

Files processed locally — never uploaded to our servers
Free Instant Private

Verify it yourself: press F12, open the Network tab, and use this tool — your files are never uploaded.

LLM Context Window Calculator at a glance

Price
Free
Account
Not required
File uploads
None — your files are never uploaded

Who uses Developer Tools?

Developers and engineers formatting JSON, testing regex, hashing data, encoding values or building API requests.

How to Use LLM Context Window Calculator

Follow these simple steps to get instant results in your browser.

1

Pick a Model

Choose the model you will call — the page shows its context window and its input/output price per 1M tokens.

2

Fill In the Five Segments

Paste the system prompt, then set history turns and tokens per turn, RAG chunks and tokens per chunk, tool-definition tokens and reserved output tokens.

3

Read the Bar and the Cost

Check the segmented budget bar for the window share, then read the cost per request and the monthly projection for your request volume.

💡

What is LLM Context Window Calculator & How Does It Work?

LLM Context Window Calculator plans how a prompt fits inside a model's context window before you send it. Pick a model — GPT-5, GPT-5 mini, GPT-4o, Claude Sonnet 4.5, Opus 4.1, Haiku 4.5, Gemini 2.5 Pro and Flash, Llama 4 Scout or DeepSeek V3.2 and R1 — then fill in the five parts of a request: the system prompt, the conversation history, the retrieved RAG chunks, the tool definitions, and the tokens reserved for the reply. A segmented budget bar shows each part's share of the window, and the page shows the cost per request and per month.

Context windows grew fast in 2026: GPT-5 and the Claude 4 family offer 200k–400k tokens, Gemini 2.5 Pro passes 1M, and Llama 4 Scout reaches 10M. But a big window is not a free pass — long prompts cost more, slow the model down, and the model pays less attention to the middle of a very long context. Budgeting the window first is how agent loops and RAG pipelines stay fast and affordable.

Token counts from pasted text are heuristic estimates (~4 characters per token) and prices are public list prices as of 18 Nov 2026, labelled on the page as estimates, never billing records. Providers reprice quarterly, so check the provider's pricing page before budgeting. Use the LLM Token Counter for exact GPT token counts.

⚡

Key Features & Capabilities

✓

11 Models, 2026 Limits

GPT-5, Claude 4, Gemini 2.5, Llama 4 Scout and DeepSeek with their current context windows.

✓

Segmented Budget Bar

System prompt, history, RAG chunks, tools and reserved output shown as coloured shares of the window.

✓

Cost Per Request and Month

Input + output pricing per request, scaled to your daily request volume over 30 days.

✓

Over-Limit Warning

Plans that exceed the window are flagged with the exact overflow in tokens.

✓

Dated Pricing Table

Every model's list price shown with a visible 'prices as of 18 Nov 2026' date.

Pro Tips

  • •Bookmark this tool for instant one-click access anytime.
  • •Drag and drop files directly onto the input surface for fastest handling.
  • •All processing happens in your browser session for maximum speed and data safety.

🎯 Common Use Cases

Sizing a RAG PipelineDecide how many chunks to retrieve per query without blowing the context window or the budget.
Budgeting an Agent LoopProject the monthly cost of an agent that calls the model hundreds of times a day with tool definitions attached.
Choosing Between ModelsCompare what the same prompt costs and how much window it uses on GPT-5, Claude Sonnet 4.5 and Gemini 2.5 Pro.
Planning a Long Support ConversationWork out how many history turns a support bot can keep before the plan exceeds the window — the defaults (12 turns × 800 tokens) use only 10.5% of Claude Sonnet 4.5’s window, so there is room to grow.
📐

LLM Context Window Calculator - Budget and Cost

Formula Equation:
Total tokens = system + history + RAG + tools + reserved output; cost per request = (input ÷ 1,000,000 × input price) + (output ÷ 1,000,000 × output price); monthly cost = cost per request × requests per day × 30

Input tokens are everything sent to the model (system prompt, history, RAG chunks, tool definitions); output tokens are the reply you reserve room for. The used percentage is total tokens ÷ context window × 100. Pasted text is estimated at ~4 characters per token.

✏️

Worked Example

  1. 112,000 input tokens and 1,500 output tokens on GPT-5 ($1.25 in / $10.00 out per 1M)
  2. 2Cost per request = (12,000 ÷ 1,000,000 × $1.25) + (1,500 ÷ 1,000,000 × $10.00) = $0.015 + $0.015 = $0.0300
  3. 3At 200 requests a day, monthly cost = $0.0300 × 200 × 30 = $180.00
📚

Sources & Further Reading

Frequently Asked Questions about LLM Context Window Calculator

Frequently asked questions

Into five segments: the system prompt (pasted text, estimated at ~4 characters per token), conversation history (turns × tokens per turn), retrieved RAG chunks (chunks × tokens per chunk), tool definitions, and tokens reserved for the model’s reply. The bar shows each segment’s share of the model’s context window.

GPT-5, GPT-5 mini, GPT-4o, Claude Sonnet 4.5, Claude Opus 4.1, Claude Haiku 4.5, Gemini 2.5 Pro and Flash, Llama 4 Scout and DeepSeek V3.2 and R1, with their 2026 context limits and public list prices as of 18 Nov 2026. Providers reprice quarterly — the page says so and these are estimates, never billing records.

The page shows “OVER LIMIT” and by how many tokens. Cut history turns, retrieve fewer RAG chunks, reserve less output, or switch to a larger-window model such as Gemini 2.5 Pro (1M+ tokens) or Llama 4 Scout (10M tokens).

Cost per request is (input tokens ÷ 1,000,000 × input price) + (reserved output tokens ÷ 1,000,000 × output price), and the monthly figure is that cost × requests per day × 30. For example, 12,000 input and 1,500 output tokens on GPT-5 cost about $0.0300 per request.

With the defaults — Claude Sonnet 4.5, the sample system prompt (≈ 28 tokens), 12 history turns × 800 tokens, 8 RAG chunks × 600 tokens, 2,500 tool-definition tokens and 4,000 reserved output tokens — the plan uses 20,928 tokens, 10.5% of the 200,000-token window. That is about $0.1108 per request, or $664.70 a month at 200 requests a day.

Llama 4 Scout, at 10,000,000 tokens. Gemini 2.5 Pro and Flash are next at 1,048,576 tokens each. The smallest window here is DeepSeek R1 at 64,000 tokens — check the model picker before planning a long prompt.

Complementary utilities for your workflow

View all →
You are here

LLM Context Window Calculator

Plan a prompt’s fit in a model’s context window, with cost.

Current tool

LLM Token Counter

Count tokens for GPT and Claude models, with cost estimates.

Try tool