How to estimate LLM token costs.
A five-minute method that gets you within the right order of magnitude.
- Count input tokens. A rough rule for English is about 4 characters per token. Paste a real prompt into the calculator to estimate it.
- Count output tokens. Measure a few real responses. Reasoning models also bill hidden thinking tokens as output.
- Multiply by volume. Cost = (input tokens × input price + output tokens × output price) × requests ÷ 1,000,000.
- Subtract caching. Repeated prefixes (system prompts, documents) can bill at the cached rate.
- Check the fine print. Long prompts can trigger higher rates: OpenAI above 272K tokens, Google and xAI above 200K on several models, Claude Haiku 5.5 above 100K.
Note that tokenizers differ: Anthropic says Claude 4.7 and later produce about 30% more tokens for the same text than earlier Claude models.
All prices from official provider pages, checked Oct 20, 2026. See sources.
Sponsored
Your API or dev tool here. Reach developers comparing model costs right now.