Enter document tokens, system/history overhead, a reserved output budget, and the target model window; Model Ruler reports headroom or overflow and whether truncation, summarization, RAG, or chunking is required. It is a planning estimate; confirm the current model limit with the provider.
Tests whether a planned document, system/prompt overhead, and output reserve fit inside a target context window.
Formula: total_required_tokens = doc_tokens + overhead_tokens + expected_output_tokens; headroom = model_context_window - total_required_tokens
Audit coverage: Context growth
What does this calculator compute?
It adds your document tokens, prompt overhead, and reserved output against a target model context window and reports the headroom or the overflow you need to remove.
What should I check before committing to a workload shape?
Account for system prompt, retrieved or pasted content, conversation history, and the output reserve together — not just the input. Confirm the current context limit for your target model, since limits change across versions, and leave headroom so the response isn't truncated.
Is this a quote or a benchmark?
Neither. It is a computed estimate. Real-world cost varies by rate-limit shape, caching, token-count precision, and provider-specific discounts not reflected in the public pricing table.
This is a context-window planning tool; results depend on the model's current context limit, prompt overhead, retrieved or pasted content, and output reserve, not on provider price rows. Confirm the context limit for the target model version before committing to a prompt, RAG, or summarization design. View methodology.