TokenCalculator
AI token calculator
Free AI token calculator for GPT, Claude, Gemini, and more. Count tokens in your browser, compare LLM cost per token, and project monthly API spend. Text never leaves your device.
OpenAI tokenizer & token counter · LLM cost per token · RAG cost calculator · Embedding cost · GPU vs API cost · Context window · Tokenizer comparison · LLM pricing comparison · Cheapest LLM API · All tools
Cost calculator
Paste a prompt, tune cache and batch, compare models, and share the estimate URL. Token text never leaves this browser.
- Input tokens
- 65
- Output tokens
- 512
- Input cost
- $0.00013
- Output cost
- $0.004096
- Characters
- 306
- Words
- 51
Monthly projector
- Daily
- $2.113
- Monthly
- $63.39
- Yearly
- $771.25
Rates in $2.00/1M · out $8.00/1M
Context 577 / 1,000,000 · Verified · official pricing
gpt-tokenizer · o200k_base
Token pieces
ExactCompare models
Same prompt, output size, cache, and batch settings across models.
| Model | Accuracy | Input tok | Request | Monthly |
|---|---|---|---|---|
DeepSeek V4 FlashDeepSeek | Approx | 77 | $0.000154 | $2.31 |
Gemini 2.5 FlashGoogle | Approx | 77 | $0.001303 | $19.55 |
GPT-4.1OpenAI | Exact | 65 | $0.004226 | $63.39 |
Claude Sonnet 5Anthropic | Approx | 77 | $0.005274 | $79.11 |
LLM pricing per 1M tokens
Sample input and output rates from the curated catalog. Open a model for full details, or use the calculator above for your prompt.
| Model | Provider | Input / 1M | Output / 1M | Verified |
|---|---|---|---|---|
| GPT-5 | OpenAI | $1.25/1M | $10.00/1M | |
| GPT-5.6 Terra | OpenAI | $2.00/1M | $12.00/1M | |
| GPT-4o mini | OpenAI | $0.150/1M | $0.600/1M | |
| Claude Sonnet 5 | Anthropic | $2.00/1M | $10.00/1M | |
| Claude Haiku 4.5 | Anthropic | $1.00/1M | $5.00/1M | |
| Gemini 2.5 Flash | $0.300/1M | $2.50/1M | ||
| Gemini 2.5 Pro | $1.25/1M | $10.00/1M | ||
| DeepSeek V3 | DeepSeek | $0.270/1M | $1.10/1M | |
| Grok 4.6 | xAI | $2.00/1M | $6.00/1M |
Estimate cost for your usage · Price one prompt across all models · Compare models side by side · LLM API pricing ranks · Cheapest LLM API · Full sortable pricing table · Same model, cheapest host
Tool shortcuts
Jump to RAG, embedding, GPU vs API, context window, and more.
Tools
Small utilities next to the main calculator. Each one answers a single job.
- GPU / LLM cost calculatorCompare catalog API spend to cloud GPU rental or purchase amortization. Break-even volume and capacity check.
- Embedding cost calculatorEstimate corpus indexing and query embedding spend. Compare reference embed models and optional batch discounts.
- RAG cost calculatorEstimate corpus embedding, per-query retrieval pack, and generation cost. See which line dominates monthly spend.
- Context window calculatorBudget system, history, RAG, and reserved output against a model window. See fit, headroom, and other models that hold the same total.
- Tokenizer comparisonPaste once and compare Exact OpenAI encodings vs Approx Claude, Gemini, and host tokenizers. See deltas and example cost.
- Token visualizerSee Exact OpenAI token pieces as colored chips with token IDs. Switch o200k and cl100k encodings.
- Tokens ↔ wordsRough Approx converter between words, characters, and tokens for English budgeting.
- Cache savingsEstimate how much prompt caching saves at your hit rate and monthly volume.
- Batch pricingCompare standard vs Batch API cost for the same token profile and job count.
- Cheapest LLM APIRank every catalog model by input rate and an example request of 1000 input tokens and 500 output tokens.
- Cheapest frontier modelsGPT-5, Claude, Gemini Pro, and Grok class rows ranked by published input rate.
- Cheapest models for long repliesRank by output rate plus an example with 2000 output tokens for chat and writing.
- Cheapest long context modelsModels with 128K or larger windows, ranked by input rate, with published tier notes.
- Price one prompt across all modelsPaste a prompt once and see token count plus API cost for every model in the catalog.
- Same model, cheapest hostCompare Groq, Together, Fireworks, and first-party rates when the same model is listed more than once.
Pricing catalog
124 models · 10 providers · rates checked . Example column is 1000 input tokens and 500 output tokens. Official pages, not a live scrape.
| Count | |||||||
|---|---|---|---|---|---|---|---|
| Gemini 1.5 Flash-8B | 1M | $0.037/1M | $0.150/1M | n/a | $0.000112 | Approx | |
| Command R7B | Cohere | 128K | $0.037/1M | $0.150/1M | n/a | $0.000112 | Approx |
| Llama 3.2 1B (Groq) | Groq | 128K | $0.040/1M | $0.040/1M | n/a | $0.00006 | Approx |
| GPT-5 Nano | OpenAI | 128K | $0.050/1M | $0.400/1M | $0.005/1M | $0.00025 | Exact |
| Llama 3.1 8B Instant (Groq) | Groq | 128K | $0.050/1M | $0.080/1M | n/a | $0.00009 | Approx |
| Mistral Small | Mistral | 128K | $0.060/1M | $0.180/1M | n/a | $0.00015 | Approx |
| Llama 3.2 3B (Groq) | Groq | 128K | $0.060/1M | $0.060/1M | n/a | $0.00009 | Approx |
| Llama 3.2 3B (Together) | Together AI | 128K | $0.060/1M | $0.060/1M | n/a | $0.00009 | Approx |
| Gemma 7B (Groq) | Groq | 8K | $0.070/1M | $0.070/1M | n/a | $0.000105 | Approx |
| Gemini 1.5 Flash | 1M | $0.075/1M | $0.300/1M | $0.019/1M | $0.000225 | Approx | |
| Gemini 2.0 Flash-Lite | 1M | $0.075/1M | $0.300/1M | $0.019/1M | $0.000225 | Approx | |
| GPT-4.1 Nano | OpenAI | 1M | $0.100/1M | $0.400/1M | $0.025/1M | $0.0003 | Exact |
| Gemini 2.0 Flash | 1M | $0.100/1M | $0.400/1M | $0.025/1M | $0.0003 | Approx | |
| Gemini 2.5 Flash-Lite | 1M | $0.100/1M | $0.400/1M | $0.010/1M | $0.0003 | Approx | |
| Llama 3.2 3B (Fireworks) | Fireworks | 128K | $0.100/1M | $0.100/1M | n/a | $0.00015 | Approx |
| Llama 4 Scout (Groq) | Groq | 128K | $0.110/1M | $0.340/1M | n/a | $0.00028 | Approx |
| DeepSeek Coder | DeepSeek | 128K | $0.140/1M | $0.280/1M | n/a | $0.00028 | Approx |
| DeepSeek V4 Flash | DeepSeek | 1M | $0.140/1M | $0.280/1M | $0.003/1M | $0.00028 | Approx |
| DeepSeek VL | DeepSeek | 4K | $0.140/1M | $0.280/1M | n/a | $0.00028 | Approx |
| GPT-4o mini | OpenAI | 128K | $0.150/1M | $0.600/1M | $0.075/1M | $0.00045 | Exact |
| Ministral 8B | Mistral | 128K | $0.150/1M | $0.150/1M | n/a | $0.000225 | Approx |
| Mistral Nemo | Mistral | 128K | $0.150/1M | $0.150/1M | n/a | $0.000225 | Approx |
| Pixtral 12B | Mistral | 128K | $0.150/1M | $0.150/1M | n/a | $0.000225 | Approx |
| Command R | Cohere | 128K | $0.150/1M | $0.600/1M | n/a | $0.00045 | Approx |
| Command R (08-2024) | Cohere | 128K | $0.150/1M | $0.600/1M | n/a | $0.00045 | Approx |
| Llama 3.2 11B Vision (Groq) | Groq | 128K | $0.180/1M | $0.180/1M | n/a | $0.00027 | Approx |
| Llama 3.1 8B (Together) | Together AI | 128K | $0.180/1M | $0.180/1M | n/a | $0.00027 | Approx |
| GPT-5.6 Luna | OpenAI | 1.1M | $0.200/1M | $1.20/1M | $0.020/1M | $0.0008 | Exact |
| Gemma 3 27B | 128K | $0.200/1M | $0.400/1M | n/a | $0.0004 | Approx | |
| Grok 2 Mini | xAI | 131K | $0.200/1M | $0.500/1M | n/a | $0.00045 | Approx |
| Grok 4 Fast | xAI | 256K | $0.200/1M | $0.500/1M | n/a | $0.00045 | Approx |
| Mistral Saba | Mistral | 33K | $0.200/1M | $0.600/1M | n/a | $0.0005 | Approx |
| Gemma 2 9B (Groq) | Groq | 8K | $0.200/1M | $0.200/1M | n/a | $0.0003 | Approx |
| Llama Guard 3 8B (Groq) | Groq | 8K | $0.200/1M | $0.200/1M | n/a | $0.0003 | Approx |
| Mistral 7B (Together) | Together AI | 33K | $0.200/1M | $0.200/1M | n/a | $0.0003 | Approx |
| Llama 3.1 8B (Fireworks) | Fireworks | 128K | $0.200/1M | $0.200/1M | n/a | $0.0003 | Approx |
| MythoMax L2 13B (Fireworks) | Fireworks | 4K | $0.200/1M | $0.200/1M | n/a | $0.0003 | Approx |
| Llama 4 Maverick (Fireworks) | Fireworks | 1M | $0.220/1M | $0.880/1M | n/a | $0.00066 | Approx |
| Mixtral 8x7B (Groq) | Groq | 33K | $0.240/1M | $0.240/1M | n/a | $0.00036 | Approx |
| GPT-5 Mini | OpenAI | 128K | $0.250/1M | $2.00/1M | $0.025/1M | $0.00125 | Exact |
| Claude 3 Haiku | Anthropic | 200K | $0.250/1M | $1.25/1M | $0.030/1M | $0.000875 | Approx |
| Gemini 3.1 Flash-Lite | 1M | $0.250/1M | $1.50/1M | $0.025/1M | $0.001 | Approx | |
| Mistral Tiny | Mistral | 33K | $0.250/1M | $0.250/1M | n/a | $0.000375 | Approx |
| DeepSeek V3 | DeepSeek | 128K | $0.270/1M | $1.10/1M | $0.070/1M | $0.00082 | Approx |
| Llama 4 Maverick (Together) | Together AI | 1M | $0.270/1M | $0.850/1M | n/a | $0.000695 | Approx |
| DeepSeek Chat | DeepSeek | 128K | $0.280/1M | $0.420/1M | $0.028/1M | $0.00049 | Approx |
| QwQ 32B (Groq) | Groq | 128K | $0.290/1M | $0.390/1M | n/a | $0.000485 | Approx |
| Qwen3 32B (Groq) | Groq | 131K | $0.290/1M | $0.590/1M | n/a | $0.000585 | Approx |
| Gemini 2.5 Flash | 1M | $0.300/1M | $2.50/1M | $0.030/1M | $0.00155 | Approx | |
| DeepSeek R1 Distill Qwen 32B | DeepSeek | 128K | $0.300/1M | $0.600/1M | n/a | $0.0006 | Approx |
| Grok 3 Mini | xAI | 131K | $0.300/1M | $0.500/1M | $0.075/1M | $0.00055 | Approx |
| Command Light | Cohere | 4K | $0.300/1M | $0.600/1M | n/a | $0.0006 | Approx |
| Qwen2.5 7B (Together) | Together AI | 33K | $0.300/1M | $0.300/1M | n/a | $0.00045 | Approx |
| GPT-4.1 Mini | OpenAI | 1M | $0.400/1M | $1.60/1M | $0.100/1M | $0.0012 | Exact |
| Mistral Medium 3 | Mistral | 128K | $0.400/1M | $2.00/1M | n/a | $0.0014 | Approx |
| DeepSeek V4 Pro | DeepSeek | 1M | $0.435/1M | $0.870/1M | $0.004/1M | $0.00087 | Approx |
| GPT-3.5 Turbo | OpenAI | 16K | $0.500/1M | $1.50/1M | n/a | $0.00125 | Exact |
| Gemini 1.0 Pro | 33K | $0.500/1M | $1.50/1M | n/a | $0.00125 | Approx | |
| Gemini 3 Flash | 1M | $0.500/1M | $3.00/1M | $0.050/1M | $0.002 | Approx | |
| Mistral Large 3 | Mistral | 128K | $0.500/1M | $1.50/1M | n/a | $0.00125 | Approx |
| DeepSeek R1 | DeepSeek | 128K | $0.550/1M | $2.19/1M | $0.140/1M | $0.001645 | Approx |
| DeepSeek Reasoner | DeepSeek | 128K | $0.550/1M | $2.19/1M | $0.140/1M | $0.001645 | Approx |
| Llama 3.3 70B (Groq) | Groq | 128K | $0.590/1M | $0.790/1M | n/a | $0.000985 | Approx |
| Llama 3.3 70B SpecDec (Groq) | Groq | 8K | $0.590/1M | $0.990/1M | n/a | $0.001085 | Approx |
| Open Mixtral 8x7B | Mistral | 33K | $0.700/1M | $0.700/1M | n/a | $0.00105 | Approx |
| DeepSeek R1 Distill Llama 70B (Groq) | Groq | 128K | $0.750/1M | $0.990/1M | n/a | $0.001245 | Approx |
| Claude 3.5 Haiku | Anthropic | 200K | $0.800/1M | $4.00/1M | $0.080/1M | $0.0028 | Approx |
| Qwen2.5 Coder 32B (Together) | Together AI | 33K | $0.800/1M | $0.800/1M | n/a | $0.0012 | Approx |
| Llama 3.1 70B (Together) | Together AI | 128K | $0.880/1M | $0.880/1M | n/a | $0.00132 | Approx |
| Llama 3.3 70B (Together) | Together AI | 128K | $0.880/1M | $0.880/1M | n/a | $0.00132 | Approx |
| DeepSeek R1 (Fireworks) | Fireworks | 128K | $0.900/1M | $0.900/1M | n/a | $0.00135 | Approx |
| DeepSeek V3 (Fireworks) | Fireworks | 128K | $0.900/1M | $0.900/1M | n/a | $0.00135 | Approx |
| Llama 3.1 70B (Fireworks) | Fireworks | 128K | $0.900/1M | $0.900/1M | n/a | $0.00135 | Approx |
| Llama 3.3 70B (Fireworks) | Fireworks | 128K | $0.900/1M | $0.900/1M | n/a | $0.00135 | Approx |
| Mixtral 8x22B (Fireworks) | Fireworks | 66K | $0.900/1M | $0.900/1M | n/a | $0.00135 | Approx |
| Qwen2.5 32B (Fireworks) | Fireworks | 33K | $0.900/1M | $0.900/1M | n/a | $0.00135 | Approx |
| Qwen2.5 72B (Fireworks) | Fireworks | 33K | $0.900/1M | $0.900/1M | n/a | $0.00135 | Approx |
| Claude Haiku 4.5 | Anthropic | 200K | $1.00/1M | $5.00/1M | $0.100/1M | $0.0035 | Approx |
| Codestral | Mistral | 256K | $1.00/1M | $3.00/1M | n/a | $0.0025 | Approx |
| Command Nightly | Cohere | 128K | $1.00/1M | $2.00/1M | n/a | $0.002 | Approx |
| o1-mini | OpenAI | 128K | $1.10/1M | $4.40/1M | n/a | $0.0033 | Exact |
| o3-mini | OpenAI | 200K | $1.10/1M | $4.40/1M | $0.550/1M | $0.0033 | Exact |
| o4-mini | OpenAI | 200K | $1.10/1M | $4.40/1M | $0.275/1M | $0.0033 | Exact |
| Mixtral 8x22B (Together) | Together AI | 66K | $1.20/1M | $1.20/1M | n/a | $0.0018 | Approx |
| Qwen2.5 72B (Together) | Together AI | 33K | $1.20/1M | $1.20/1M | n/a | $0.0018 | Approx |
| GPT-5 | OpenAI | 400K | $1.25/1M | $10.00/1M | $0.125/1M | $0.00625 | Exact |
| Gemini 1.5 Pro | 2M | $1.25/1M | $5.00/1M | $0.313/1M | $0.00375 | Approx | |
| Gemini 2.0 Pro Exp | 2M | $1.25/1M | $5.00/1M | n/a | $0.00375 | Approx | |
| Gemini 2.5 Pro | 1M | $1.25/1M | $10.00/1M | $0.125/1M | $0.00625 | Approx | |
| DeepSeek V3 (Together) | Together AI | 128K | $1.25/1M | $1.25/1M | n/a | $0.001875 | Approx |
| GPT-4.1 | OpenAI | 1M | $2.00/1M | $8.00/1M | $0.500/1M | $0.006 | Exact |
| GPT-4.1 (2025-04-14) | OpenAI | 1M | $2.00/1M | $8.00/1M | $0.500/1M | $0.006 | Exact |
| GPT-5.6 Terra | OpenAI | 1.1M | $2.00/1M | $12.00/1M | $0.200/1M | $0.008 | Exact |
| o3 | OpenAI | 200K | $2.00/1M | $8.00/1M | $0.500/1M | $0.006 | Exact |
| Claude Sonnet 5 | Anthropic | 1M | $2.00/1M | $10.00/1M | $0.200/1M | $0.007 | Approx |
| Gemini 3.1 Pro | 1M | $2.00/1M | $12.00/1M | $0.200/1M | $0.008 | Approx | |
| Grok 2 | xAI | 131K | $2.00/1M | $10.00/1M | n/a | $0.007 | Approx |
| Grok 2 Vision | xAI | 33K | $2.00/1M | $10.00/1M | n/a | $0.007 | Approx |
| Grok 4.6 | xAI | 500K | $2.00/1M | $6.00/1M | $0.500/1M | $0.005 | Approx |
| Mistral Large (2407) | Mistral | 128K | $2.00/1M | $6.00/1M | n/a | $0.005 | Approx |
| Open Mixtral 8x22B | Mistral | 66K | $2.00/1M | $6.00/1M | n/a | $0.005 | Approx |
| GPT-4o | OpenAI | 128K | $2.50/1M | $10.00/1M | $1.25/1M | $0.0075 | Exact |
| GPT-4o (2024-08-06) | OpenAI | 128K | $2.50/1M | $10.00/1M | $1.25/1M | $0.0075 | Exact |
| Command A | Cohere | 256K | $2.50/1M | $10.00/1M | n/a | $0.0075 | Approx |
| Command R+ | Cohere | 128K | $2.50/1M | $10.00/1M | n/a | $0.0075 | Approx |
| Command R+ (08-2024) | Cohere | 128K | $2.50/1M | $10.00/1M | n/a | $0.0075 | Approx |
| Claude 3.5 Sonnet | Anthropic | 200K | $3.00/1M | $15.00/1M | $0.300/1M | $0.0105 | Approx |
| Claude 3 Sonnet | Anthropic | 200K | $3.00/1M | $15.00/1M | $0.300/1M | $0.0105 | Approx |
| Claude Sonnet 4.6 | Anthropic | 1M | $3.00/1M | $15.00/1M | $0.300/1M | $0.0105 | Approx |
| Grok 3 | xAI | 131K | $3.00/1M | $15.00/1M | $0.750/1M | $0.0105 | Approx |
| Grok 4 | xAI | 256K | $3.00/1M | $15.00/1M | n/a | $0.0105 | Approx |
| DeepSeek R1 (Together) | Together AI | 128K | $3.00/1M | $7.00/1M | n/a | $0.0065 | Approx |
| ChatGPT-4o Latest | OpenAI | 128K | $5.00/1M | $15.00/1M | $2.50/1M | $0.0125 | Exact |
| GPT-5.6 Sol | OpenAI | 1.1M | $5.00/1M | $30.00/1M | $0.500/1M | $0.02 | Exact |
| Claude Opus 4.6 | Anthropic | 1M | $5.00/1M | $25.00/1M | $0.500/1M | $0.0175 | Approx |
| Claude Opus 4.8 | Anthropic | 1M | $5.00/1M | $25.00/1M | $0.500/1M | $0.0175 | Approx |
| Grok Beta | xAI | 131K | $5.00/1M | $15.00/1M | n/a | $0.0125 | Approx |
| Grok Vision Beta | xAI | 8K | $5.00/1M | $15.00/1M | n/a | $0.0125 | Approx |
| Claude 2.1 | Anthropic | 200K | $8.00/1M | $24.00/1M | n/a | $0.02 | Approx |
| GPT-4 Turbo | OpenAI | 128K | $10.00/1M | $30.00/1M | $5.00/1M | $0.025 | Exact |
| o1 | OpenAI | 200K | $15.00/1M | $60.00/1M | $7.50/1M | $0.045 | Exact |
| o1-preview | OpenAI | 128K | $15.00/1M | $60.00/1M | n/a | $0.045 | Exact |
| Claude 3 Opus | Anthropic | 200K | $15.00/1M | $75.00/1M | $1.50/1M | $0.0525 | Approx |
| GPT-4 | OpenAI | 8K | $30.00/1M | $60.00/1M | n/a | $0.06 | Exact |
Official pricing sources
How the token calculator works
- Paste a prompt, document, or chat message.
- Pick a model. Exact for OpenAI encodings in your browser; Approx when the provider tokenizer is not available client-side.
- See token count and API cost. Optionally set cache hit %, Batch, and monthly volume for a budget, not just a per-request number.
What is a token? · How LLM pricing works · Prompt cost · Exact vs Approx
Deeper reading: tokenization · tokens vs words · OpenAI · Claude · Gemini · prompt caching · context windows · all guides
Compare popular models
Same pricing catalog as the calculator. Open a pair, then run your own prompt. Showing 12 highlights of 105 featured comparisons.
- GPT-5 vs Claude Opus 4.8
- GPT-5 vs Gemini 3.1 Pro
- Claude Opus 4.8 vs Gemini 3.1 Pro
- GPT-4.1 vs Claude Sonnet 5
- GPT-4.1 vs Gemini 2.5 Pro
- Claude Sonnet 5 vs Gemini 2.5 Pro
- GPT-5 Mini vs Claude Sonnet 4.6
- GPT-4.1 Mini vs Claude Haiku 4.5
- GPT-4o mini vs Gemini 2.5 Flash
- Gemini 2.5 Flash vs Claude Haiku 4.5
- Gemini 3 Flash vs GPT-5 Mini
- GPT-4.1 Nano vs Gemini 2.5 Flash-Lite
Privacy & trust
Built as a privacy-first cost workstation: accuracy labels and local processing are product features, not footnotes.
Text stays local
Prompts are tokenized in your browser. We do not upload your text to a server.
Honest Exact / Approx
OpenAI encodings are Exact via gpt-tokenizer. Other providers are labeled Approx, never silently faked.
Curated prices
Rates are manually verified against official pages with lastVerified dates and outbound source links. No scrape theater.
Share without a backend
Use Copy share link when you want a bookmarkable URL with your estimate. Day to day browsing keeps clean addresses.
Token calculator FAQ
- What is an AI token calculator?
- An AI token calculator counts how many tokens a prompt uses for a given model, then estimates API cost from published input and output rates per 1M tokens. TokenCalculator does both in your browser.
- What are tokens in AI?
- Tokens are the chunks of text a model reads and generates. They may be whole words, parts of words, spaces, or punctuation. Providers bill by token count, not by word count.
- Does TokenCalculator send my text to a server?
- No. Tokenization and cost estimates run in your browser. Your prompt text is not uploaded to TokenCalculator servers.
- What do Exact and Approx mean?
- Exact uses a matching OpenAI tokenizer encoding in the browser. Approx means the provider tokenizer is not available in-browser, so we use a labeled heuristic instead of faking precision.
- How do I estimate LLM cost per token?
- Pick a model, count input tokens, set expected output tokens, then apply input and output prices per 1M tokens. Use the cost calculator for cache, batch, and monthly volume projections.
- Are the API prices live?
- Prices are curated from official provider docs (with a weekly sync script + PR review). Each model has a lastVerified date and link to the official page. We do not pretend rates are a live streaming API.