AI Context Window & Chunk Planner
A free, browser-based calculator. Runs entirely in your browser — no sign up, nothing stored.
Your text & model
Token counts are approximate (no tokenizer). Keep a buffer — runs in your browser, nothing uploaded.
Result
How to use this calculator
- Paste the prompt or document you want to fit.
- Pick a model preset (sets the context window, which you can edit) and reserve some tokens for the output.
- Set a maximum chunk size and overlap if it needs splitting.
- Read whether it fits, and if not, the recommended chunk size, count and a copyable chunking instruction.
How it works
The text is converted to an approximate token count. The available room is the context window minus the tokens you reserve for the model's answer.
If the text fits in the available room, you're done. If not, it splits into overlapping chunks: each chunk is up to your max size, and the overlap carries context across the boundaries. Chunk count = ceil(tokens ÷ (chunk size − overlap)).
These are approximations for planning — keep a buffer below the hard limit.
Worked example
A 20,000-token document into an 8k context. With 1,000 tokens reserved for output and a 4,000-token chunk size with 500 overlap, the planner recommends six overlapping chunks processed in order.
Common mistakes
- Forgetting to reserve room for the output — the answer also consumes context.
- Zero overlap on a long document — a little overlap keeps context flowing across chunk boundaries.
Frequently asked questions
Does this use AI or send my prompt anywhere?
No. It runs entirely in your browser using rule-based checks — your prompt is never uploaded or sent to any AI model. Still, avoid pasting passwords, API keys or private data into any tool.
Why reserve tokens for output?
The context window holds both your input and the model's answer. If you fill it entirely with input, there's no room left to respond, so reserve a realistic output budget.
Related tools
Tip: Enter any known values to calculate the remaining results.
All calculations run in your browser. Your inputs are never saved or transmitted.



