Slide up to estimate cost at production scale.
| Model | Input | Output | Cost per call | Total |
|---|
Prices are per million tokens and reflect published list rates at the time of writing. Always confirm current pricing on the provider’s own pricing page before budgeting.
AI Prompt Token Calculator — Estimate OpenAI and Anthropic API Costs Before You Build
Paste any prompt and instantly see the estimated token count and what it would cost across current OpenAI and Anthropic models. Adjust the expected response length and the number of API calls to project spend at production scale — useful before you commit to a model, and essential before you ship anything that runs thousands of times a day.
How tokens actually work
Large language models do not read characters or words — they read tokens, which are fragments of text produced by the model’s tokenizer. In English, a token averages roughly four characters, or about three-quarters of a word. Common words are usually a single token; rare words, names, code, and non-English text often split into several. Both input (your prompt, system instructions, and any context you attach) and output (the model’s reply) are billed, at different rates.
Why output tokens dominate your bill
Across nearly every current model, output costs around five times more than input. A verbose system prompt is rarely the expensive part — long generated responses are. If you are optimising cost, capping response length and asking for concise output usually beats trimming your prompt. Two levers matter more than model choice for most workloads: prompt caching, which can cut repeated input cost by up to 90%, and the Batch API, which halves both input and output for work that is not latency-sensitive.
How this estimate is calculated
This tool blends two approximations — characters divided by four, and words multiplied by 1.33 — and averages them. That lands close for ordinary English prose. It will under-count for source code, JSON, mathematical notation, and non-Latin scripts, all of which tokenize less efficiently. For exact counts, use the provider’s own tokenizer library; for budgeting and model comparison, an estimate within a few percent is more than sufficient.
Choosing a model on cost
- Start cheap and move up. Classification, routing, extraction, and summarisation rarely need a flagship model. Budget tiers handle them well at a fraction of the cost.
- Compare on your real prompt, not a benchmark. Paste the prompt you will actually ship — that is what this tool is for.
- Project at scale before you commit. A cost that looks trivial per call becomes a serious line item at 100,000 calls. Use the slider.
- Reuse context deliberately. If your system prompt is stable across calls, prompt caching is the single biggest saving available.
Frequently asked questions
How accurate is this token estimate?
Typically within a few percent for English prose. Code, JSON, and non-English text tokenize less efficiently, so treat those figures as a floor rather than an exact number.
Why is output more expensive than input?
Generating tokens requires a full forward pass through the model for each one, whereas input can be processed in parallel. That compute asymmetry is reflected in the pricing, typically at a 5:1 ratio.
Are these prices current?
Rates were verified against published provider pricing at the time of writing. AI pricing moves frequently — always confirm on the provider’s own pricing page before committing to a budget.
Does this tool send my prompt anywhere?
No. Token estimation runs entirely in your browser. Your prompt is never transmitted, logged, or stored.
Related tools: Subscription Creep Calculator, SaaS Cost Calculator, and Word Counter. Comparing AI assistants? Read our ChatGPT vs Claude vs Gemini review.