Token Calculator for LLMs
Calculate tokens and estimate API costs for OpenAI GPT, Anthropic Claude, and Google Gemini
Input Text
0
Tokens
0
Words
0
Characters (no spaces)
0
Total Characters
Pricing by Model
| Model | Provider | Context | Input/1M | Input(cached)/1M | Output/1M | Input Price | Input(cached) | Output Price |
|---|---|---|---|---|---|---|---|---|
| GPT-4.1 | OpenAI/Azure | 1M | $2 | $0.5 | $8 | $0.0000 | $0.0000 | $0.0000 |
| GPT-4.1 mini | OpenAI/Azure | 1M | $0.4 | $0.1 | $1.6 | $0.0000 | $0.0000 | $0.0000 |
| GPT-4.1 nano | OpenAI/Azure | 1M | $0.1 | $0.025 | $0.4 | $0.0000 | $0.0000 | $0.0000 |
| o3 | OpenAI/Azure | 200K | $2 | $0.5 | $8 | $0.0000 | $0.0000 | $0.0000 |
| o4-mini | OpenAI/Azure | 200K | $1.1 | $0.275 | $4.4 | $0.0000 | $0.0000 | $0.0000 |
| GPT-4o | OpenAI/Azure | 128K | $5 | $2.5 | $20 | $0.0000 | $0.0000 | $0.0000 |
| GPT-4o-mini | OpenAI/Azure | 128K | $0.6 | $0.3 | $2.4 | $0.0000 | $0.0000 | $0.0000 |
| Claude Opus 4 | Anthropic | 200K | $15 | - | $75 | $0.0000 | - | $0.0000 |
| Claude Sonnet 4 | Anthropic | 200K | $3 | - | $15 | $0.0000 | - | $0.0000 |
| Claude Sonnet 3.7 | Anthropic | 200K | $3 | - | $15 | $0.0000 | - | $0.0000 |
| Gemini 2.5 Flash Preview | 1M | $0.15 | - | $0.6 | $0.0000 | - | $0.0000 | |
| Gemini 2.5 Pro Preview | 1M | $1.25 | - | $10 | $0.0000 | - | $0.0000 | |
| Gemini 2.0 Flash | 1M | $0.1 | - | $0.4 | $0.0000 | - | $0.0000 | |
| Gemini 2.0 Flash-Lite | 1M | $0.075 | - | $0.3 | $0.0000 | - | $0.0000 |
📝 Important Notes
- • Token Estimation: This calculator uses an approximate estimation (~1 token per 4 characters). For exact counts, use the official tokenizer libraries.
- • Pricing: All prices are per 1 million tokens. Actual costs may vary based on your usage and pricing tier.
- • Cached Input: Some models (like OpenAI) offer reduced pricing for cached/repeated inputs. Not all models support this feature.
- • Context Window: The maximum number of tokens a model can process in a single request (including both input and output).
- • Privacy: All calculations are performed locally in your browser. Your text never leaves your device.