Output token estimator
You pay for the tokens a model generates, but you do not know the output length until after the call. This tool flips that around: it estimates the likely output token range before you send, from your prompt’s length and the kind of task, then shows the per-call output cost across a few common models so you can budget up front.
How it works
The tool approximates your prompt’s input tokens using the familiar four-characters-per-token rule, then applies a ratio tuned to the task type. Summarization compresses, so output is a fraction of input. Translation and question-answering stay closer to the input size or smaller. Open-ended generation expands well beyond the prompt. It reports a low-to-high range to reflect real variability, then multiplies the midpoint by an illustrative per-token output price for the selected model.
Output-to-input ratios by task type
Different tasks produce very different output lengths relative to the prompt. These are approximate ratios based on common observed behaviour:
| Task type | Typical output-to-input ratio | Notes |
|---|---|---|
| Summarization | 0.1x – 0.3x | Output much shorter than input |
| Question answering | 0.5x – 1x | Short factual or medium explanatory answer |
| Translation | 0.9x – 1.2x | Output length tracks input closely |
| Classification / labelling | 0.05x – 0.2x | Short label or category string |
| Open-ended generation | 1x – 3x+ | Output can significantly exceed prompt length |
| Code generation | 1x – 5x | Depends heavily on what is being built |
Use these ratios as a mental model alongside the estimator’s output. For code tasks especially, the range is wide — a “generate a CRUD API” prompt can produce a handful of lines or several hundred depending on context.
Controlling output cost
The surest cost control is a max_tokens (or max_completion_tokens) limit on the API call. Use the estimator’s high-end range to choose a limit that gives the model enough room to complete the task without paying for runaway generations. For example:
- A summarization prompt with an estimated 150–300 output tokens: set
max_tokens: 400to avoid truncation while capping cost. - An open-ended creative task with an estimated 800–2000 output tokens: set
max_tokens: 2500as a safety ceiling.
Why a range instead of one number
Even the same prompt can produce a short or long answer depending on the model’s sampling temperature, the phrasing, and random variation. A range gives you a budget floor and ceiling; the floor represents a minimal answer and the ceiling represents a thorough one. For billing projections, use the midpoint; for safety caps, use the top of the range.
Limitations to know
- The 4-character-per-token rule applies to English prose. Code and punctuation-heavy text tend to have slightly more tokens per character, while some CJK languages can use one token per character, making estimates optimistic for non-English input.
- Model prices used are illustrative for planning only. Always confirm current rates on the provider’s pricing page before using figures for billing or budget decisions.
- Everything is calculated in your browser. No prompt text is sent anywhere.