These calculators answer sizing questions using the counts you supply. They do not inspect a model request, run inference, or measure retrieval quality.
01 / Scope
Manual counts, custom limits.
Enter whole-token counts from the appropriate model tokenizer or a provider usage report. This release loads no tokenizer and has no model presets. There is no universal character-to-token conversion here. A tokenizer result for one encoding should not be labeled an exact count for another model. OpenAI’s tiktoken reference exposes named encodings and model mappings (checked 2026-09-30).
Capacity includes all six allocations in the planner. A model’s maximum output can be smaller than its overall context capacity; enter the output limit separately when known. A blank output maximum means that check is not performed. An output-limit breach can occur even with plenty of context headroom.
Message wrappers, tool schemas/results, reasoning and other serialization may have model-specific accounting. Put known overhead in Tools & overhead and reserve an explicit safety margin for uncertainty. A zero margin is accepted arithmetic, not evidence that overhead is zero. Anthropic’s context documentation describes Claude-specific reasoning accounting; those rules do not establish other providers’ behavior (checked 2026-09-30).
Image, PDF and audio conversion, monetary pricing, embedding execution, and API preflight validation are outside this release. Use provider documentation to verify current limits. The examples are synthetic, not provider specifications.
Why no text counter yet?
Text counting is not included in this release. Counts depend on the encoding and can differ across models. Bring counts from your own tokenizer or provider usage report; there is no text upload or approximate “exact” count here.
02 / Formulas
Three small, inspectable models.
Context allocation
used = instructions + history + tools + source + output reserve + safety margin
headroom = capacity − used. Negative headroom is displayed as an explicit overflow. Available source budget is max(0, capacity − instructions − history − tools − output reserve − safety margin); if those reserves already exceed capacity, the underlying deficit is shown.
Worked example: 2,000 instructions + 4,000 history + 1,000 tools + 20,000 source + 4,000 output + 1,000 safety = 32,000. At 32,000 capacity this fits exactly. Source of 20,001 gives one-token overflow.
Fixed-token chunking
Let source length be L, chunk size S and overlap O. Require S > 0 and 0 ≤ O < S. For L = 0, chunk count N = 0. For 0 < L ≤ S, N = 1. Otherwise N = 1 + ceil((L − S) / (S − O)).
For nonempty input, processed chunk tokens are L + (N − 1) × O. The final chunk may be shorter than S, but retains the full overlap. With L = 10,000, S = 2,000 and O = 200, chunk starts are 0, 1,800, 3,600, 5,400, 7,200 and 9,000. That is six chunks, a 1,000-token final chunk and 11,000 processed tokens.
This sliding-window model estimates text duplication. It is not semantic splitting, a retrieval recommendation, or an embedding cost estimate.
Full-history conversation growth
next request = base + t × (user tokens + assistant tokens) + next user tokens + next output reserve + safety margin
Here t counts completed user/assistant exchanges. Base excludes those repeated exchanges and includes fixed instructions, starting context and fixed tools. Assume every past message remains, message sizes are constant, and neither tools nor other overhead grows. There is no compaction/truncation or generic reasoning-block formula.
The maximum completed-exchange count uses the capacity remaining after fixed terms, divided by per-exchange growth and rounded down. Fixed terms exceeding capacity produce “None fit”; zero exchange growth produces “No growth” when fixed terms fit. The entered output maximum is checked independently.
Numerical limits
Counts must be nonnegative safe integers; chunk size must be positive. Empty, negative, fractional, nonfinite and unsafe values produce actionable feedback. Aggregate calculations also reject unsafe totals. Integer arithmetic is used for chunk boundaries and conversation multiplication before converting verified safe results for display.
03 / Evidence
Original sources. Original explanations.
These are guidance references, not independent model tests. No third-party score, ranking, dataset, figure or tokenizer asset is redistributed. Fitting a request does not prove the model will use every passage effectively.
Liu et al. · 2023 research · Checked 2026-09-30 · Review due
Lost in the Middle studied position-sensitive performance in its tasks and models. Fitting content within a window does not establish that it will be used successfully.
Original summary and citation only; no paper plots, datasets or rankings reproduced.
The research citation is historical evidence about its studied tasks/models, not a current-model ranking. References should be reviewed quarterly and before public release. Any future provider presets need current source-backed context/output limits, tokenizer coverage, accounting exceptions and a visible stale-snapshot label after 30 days; stale presets cannot support an unqualified fit verdict.
04 / Privacy & ownership
Useful without an account.
All calculations and scenario snapshots live in component memory in this tab. Inputs are not submitted, put in URLs, logged to analytics or saved to localStorage. Clear inputs removes entered counts and saved scenarios. A fresh page load starts with the authored example.
Context Budget Planner belongs to the same independently branded utility portfolio as Cheaper Inference. Its calculations do not depend on visiting a commercial service. It does not recommend models or compare prices.