Context Window Budget Planner
Token counters give you a number. This tells you whether your document actually fits before the model starts truncating it. Paste your text or enter a word count and pick a context window size. Nothing uploaded.
Results
Context Window Usage
-
A Note On Accuracy
This tool estimates tokens using a rough ratio of 1.33 tokens per word. Actual tokenization varies by model, language, and content type (code and non-English text often tokenize less efficiently than plain English prose). Use this as a planning estimate, not an exact count.
Learn more: Tokens, context windows, and truncation
How tokens work and why the ratio matters
Large language models read text as tokens, not words. A token is typically 3-4 characters, but tokenization is non-linear: English prose, code, and non-English text all tokenize differently. This calculator uses the industry rough-of-thumb ratio of 1.33 tokens per word, which is accurate for plain English narrative text but overestimates token count for most code and underestimates for dense technical writing. For example, a 1,000-word essay might use roughly 1,330 tokens, but the same word count of Python code might use only 800 tokens, and the same count of Japanese text might use 1,600 tokens.
Context window limits and truncation strategies
Every model has a context window - the maximum number of tokens it can read in a single request, including your prompt and its response. If you send text that exceeds the limit, the model silently truncates (usually from the beginning), losing information. Modern large-context models (128k tokens or more) can fit entire documents, but older or cheaper models have severe limits. This tool estimates how much room you have left after your input, so you can plan ahead. If your document barely fits, you have no room for a system prompt, complex instructions, or a long response - consider splitting the work into multiple requests or switching to a larger context window model.
FAQ
Why does tokenization vary so much between content types?
Tokens are learned by the model during training. English words are pre-learned as tokens (usually 1-3 tokens per word). Code has more special characters and fewer whole-word tokens, so it uses fewer tokens per word. Non-English languages often have much longer token sequences per word because their character sets and word structures don't align with the model's English-focused tokenizer. Use an actual tokenizer for your model (not this tool) when precision matters.
If my document takes 50% of the context window, can I ask for a long response?
No - the model must reserve token budget for its response. If you use 50% of the context window for input, you can only expect a response of roughly the remaining 50% of tokens. For large documents requiring long, detailed responses, use the largest context window model available. Some providers also support token-counting APIs so you can measure exact token usage before making a request.
What happens if I paste code or multiple languages into this tool?
This tool estimates using the 1.33 tokens-per-word ratio, which is optimized for English prose. Code will likely use fewer tokens than estimated, and non-English or mixed-language text will likely use more. For code, multiply the estimate by 0.7-0.9. For non-English text, multiply by 1.2-1.5. These are rough multipliers - always check your actual token usage with your model provider if accuracy is critical.