LLM Token Counter & Cost Estimator
Paste any prompt — get a token estimate and the per-request and monthly cost across every frontier LLM in parallel. Runs in your browser, no API keys, no logging.
How much the model writes back, as a percentage of your prompt. 20% is typical for classification or extraction; 100%+ for chat or long generation.
Total requests in your projection window (e.g. 30 000 = 1 000 / day for 30 days).
Cost across 14 models
| Model | $ Input /1M | $ Output /1M | Input cost | Output cost | Per request | × 1 requests |
|---|---|---|---|---|---|---|
Claude Opus 4.7 Anthropic | $15 | $75 | $0 | $0 | $0 | $0 |
Claude Sonnet 4.6 Anthropic | $3 | $15 | $0 | $0 | $0 | $0 |
Claude Haiku 4.5 Anthropic | $1 | $5 | $0 | $0 | $0 | $0 |
GPT-5 OpenAI | $10 | $30 | $0 | $0 | $0 | $0 |
GPT-5 mini OpenAI | $0.5 | $2 | $0 | $0 | $0 | $0 |
o3 OpenAI | $20 | $80 | $0 | $0 | $0 | $0 |
Gemini 2.5 Pro Google | $2.5 | $15 | $0 | $0 | $0 | $0 |
Gemini 2.5 Flash Google | $0.3 | $1.2 | $0 | $0 | $0 | $0 |
Llama 4 Maverick Meta | $0.5 | $1.5 | $0 | $0 | $0 | $0 |
Llama 4 Scout Meta | $0.2 | $0.6 | $0 | $0 | $0 | $0 |
DeepSeek R1 DeepSeek | $0.55 | $2.19 | $0 | $0 | $0 | $0 |
DeepSeek V3 DeepSeek | $0.27 | $1.1 | $0 | $0 | $0 | $0 |
Grok 4 xAI | $5 | $15 | $0 | $0 | $0 | $0 |
Mistral Large 2 Mistral | $2 | $6 | $0 | $0 | $0 | $0 |
How this counter works
Real tokenization differs per vendor — OpenAI uses cl100k_base / o200k_base, Anthropic ships its own tokenizer, Llama uses a SentencePiece variant. Bundling all of them as WASM would balloon the page. Instead, this tool uses a BPE-style heuristic: it takes the larger of chars / 4 and words × 1.3. The result lands within roughly 10 % of real tokenizer counts for natural English, code and mixed content — enough for cost estimates and budget conversations.
For precise counts before a production rollout, use the vendor SDK:tiktoken for OpenAI, @anthropic-ai/tokenizer for Claude.
What to watch in your bill
- Output dominates. Output tokens are typically 3–5× more expensive than input. Even a small ratio shift moves the bill significantly.
- Frontier vs. cheap-bulk is ~100×. Same prompt, Opus 4.7 costs ~150× more than Llama 4 Scout. Route accordingly.
- Caching changes everything. Prompt caching (Anthropic, OpenAI, Gemini) cuts repeated-input cost by 90 % — this calculator does NOT account for it.
- Self-hosting is its own equation. Llama / DeepSeek prices here are hosted-API; running on your own GPUs trades $/token for $/hour.
