TokenPad
Counting

Context Window Budget Planner

Allocate a context window before you fill it and find out it did not fit.

Settings
Context BudgetExact
0Token change
Token change0no change
Input tokens0what you pasted
Output tokens0what you would send
Token cost of this result
Output tokens0
As input$0.00
× 100K requests$0.00

Everything on this page runs in your browser. Nothing you paste is transmitted, because there is no server here to transmit it to.

Result
 

Fixed overhead first

System prompt plus tool definitions are paid on every request before anything useful is loaded. On a heavily-tooled agent that can be several percent of the window, permanently.

Seeing it as a share of the window rather than as an absolute number is what makes people trim it.

Why the safety margin is not optional

Token counts for models without a public browser tokenizer are estimates, and a request that exceeds the window fails outright rather than degrading gracefully.

Fifteen percent of headroom costs nothing you will notice and prevents the class of failure that only appears under production inputs.

Frequently asked questions

How much should I reserve for output?
The longest answer you actually need, not the model maximum. Reserving 8,000 tokens for answers that run to 400 wastes window you could have retrieved into.
Does prompt caching change the allocation?
No. Caching changes what cached tokens cost, not whether they occupy the window. A cached system prompt takes exactly as much space as an uncached one.

More counting tools