Free AI Token Calculator — Count Tokens & Estimate API Costs
Count tokens for GPT-5, GPT-4o, Claude, Gemini, Llama, DeepSeek and 81+ models. All calculations run locally in your browser — your text never leaves your computer.
AI Token Calculator
Your text
Model & pricing
OpenAI models use the real tiktoken tokenizer; every other provider uses a calibrated estimate.
Token count · o200k_base
Tokens
—
Characters
0
Words
0
Lines
0
Bytes (UTF-8)
0
Tokens per char
—
Input cost
—
Output cost
—
Total
—
Why developers use tokenestimate
ΣExact tiktoken counts
Uses the same Byte-Pair Encoding tokenizer as OpenAI's servers for accurate results.
$Cost before you code
Estimate API costs before making requests. Supports custom pricing for any model.
#100% local & private
All calculations run in your browser. No data uploaded, no tracking, no accounts needed.
⎈Built for AI workflows
Designed for developers, researchers, and AI engineers who need quick token estimates.
Supported models & pricing
Count tokens and estimate costs for 81+ models across every major AI provider. Prices are USD per 1M tokens, last verified 2026-10-02.
| Model | Counting | Context | Input $ / 1M | Output $ / 1M |
|---|---|---|---|---|
| OpenAI | ||||
| GPT-5.5 | exact tiktoken | 1M | $5 | $30 |
| GPT-5 | exact tiktoken | 400K | $1.25 | $10 |
| GPT-5 mini | exact tiktoken | 400K | $0.25 | $2 |
| GPT-5 nano | exact tiktoken | 400K | $0.05 | $0.4 |
| GPT-4o | exact tiktoken | 128K | $2.5 | $10 |
| GPT-4o mini | exact tiktoken | 128K | $0.15 | $0.6 |
| GPT-4.1 | exact tiktoken | 1M | $2 | $8 |
| GPT-4.1 mini | exact tiktoken | 1M | $0.4 | $1.6 |
| GPT-4.1 nano | exact tiktoken | 1M | $0.1 | $0.4 |
| o3 | exact tiktoken | 200K | $2 | $8 |
| o4-mini | exact tiktoken | 200K | $1.1 | $4.4 |
| o3-mini | exact tiktoken | 200K | $1.1 | $4.4 |
| o1 | exact tiktoken | 200K | $15 | $60 |
| GPT-5.6 Sol | exact tiktoken | 1M | $4 | $20 |
| GPT-5.6 Terra | exact tiktoken | 1M | $2 | $12 |
| GPT-5.6 Luna | exact tiktoken | 1M | $0.2 | $1.2 |
| GPT-5.4 | exact tiktoken | 400K | $2.5 | $15 |
| GPT-5.4 mini | exact tiktoken | 400K | $0.75 | $4.5 |
| GPT-5.4 nano | exact tiktoken | 400K | $0.2 | $1.25 |
| OpenAI (legacy) | ||||
| GPT-4 Turbo | exact tiktoken | 128K | $10 | $30 |
| GPT-4 | exact tiktoken | 8K | $30 | $60 |
| GPT-3.5 Turbo | exact tiktoken | 16K | $0.5 | $1.5 |
| OpenAI embedding | ||||
| text-embedding-3-small | exact tiktoken | – | $0.02 | — |
| text-embedding-3-large | exact tiktoken | – | $0.13 | — |
| Anthropic Claude | ||||
| Claude Opus 5.5 | estimate | 1M | $4 | $20 |
| Claude Opus 5 | estimate | 200K | $5 | $25 |
| Claude Sonnet 5 | estimate | 1M | $2 | $10 |
| Claude Haiku 4.5 | estimate | 200K | $1 | $5 |
| Claude Fable 5 | estimate | 1M | $10 | $50 |
| Claude Opus 4.6 | estimate | 1M | $5 | $25 |
| Claude Sonnet 4.6 | estimate | 1M | $3 | $15 |
| Claude Opus 4.7 | estimate | 1M | $5 | $25 |
| Claude Opus 4.8 | estimate | 1M | $5 | $25 |
| Claude Fable 5.1 | estimate | 1M | $10 | $50 |
| Claude Sonnet 5.5 | estimate | 1M | $2 | $10 |
| Claude Mythos 5 | estimate | 1M | $11 | $55 |
| Claude Opus 5 (Fast mode) | estimate | 1M | $10 | $50 |
| Google Gemini | ||||
| Gemini 3.1 Pro | estimate | 2M | $2 | $12 |
| Gemini 3.6 Flash | estimate | 1M | $1.5 | $7.5 |
| Gemini 3.5 Flash | estimate | 1M | $1.5 | $9 |
| Gemini 3 Flash | estimate | 1M | $0.5 | $3 |
| Gemini 3.5 Flash-Lite | estimate | 1M | $0.3 | $2.5 |
| Gemini 2.5 Pro | estimate | 2M | $1.25 | $10 |
| Gemini 2.5 Flash | estimate | 1M | $0.3 | $2.5 |
| Gemini 2.5 Flash-Lite | estimate | 1M | $0.1 | $0.4 |
| US & EU | ||||
| Grok 4.1 (xAI) | estimate | 1M | $0.2 | $1 |
| Llama 4 (Meta) | estimate | 1M | $0.15 | $0.45 |
| Mistral Large 3 | estimate | 128K | $2 | $6 |
| Amazon Nova Pro | estimate | 300K | $0.8 | $3.2 |
| Grok 4.5 | estimate | 500K | $2 | $6 |
| Grok 4.3 | estimate | 1M | $1.25 | $2.5 |
| DeepSeek (深度求索) | ||||
| DeepSeek V4 Pro | estimate | 128K | $0.44 | $0.87 |
| DeepSeek V4 Flash | estimate | 400K | $0.14 | $0.28 |
| DeepSeek V3.2 | estimate | 128K | $0.35 | $0.42 |
| DeepSeek R1 | estimate | 64K | $0.56 | $2.5 |
| Alibaba Qwen (阿里通义) | ||||
| Qwen3 Max (通义千问) | estimate | 262K | $0.78 | $3.9 |
| Qwen3 Plus | estimate | 128K | $0.4 | $1.2 |
| Qwen3 Flash | estimate | 128K | $0.15 | $1.5 |
| Qwen3 Coder | estimate | 128K | $0.3 | $0.9 |
| Zhipu GLM (智谱) | ||||
| GLM-5 (智谱) | estimate | 200K | $1 | $3.2 |
| GLM-5.1 | estimate | 200K | $0.98 | $3.08 |
| GLM-4.7 | estimate | 200K | $0.5 | $2.2 |
| GLM-4-Flash | estimate | 128K | Free | Free |
| Moonshot Kimi (月之暗面) | ||||
| Kimi K2.6 (月之暗面) | estimate | 256K | $1 | $2.5 |
| Kimi K2.5 | estimate | 128K | $0.6 | $3 |
| Kimi K3 | estimate | 256K | $7 | $14 |
| ByteDance Doubao (火山引擎) | ||||
| Doubao 1.6 Pro (豆包) | estimate | 256K | $0.11 | $0.45 |
| Doubao 1.6 Flash | estimate | 128K | $0.01 | $0.11 |
| Doubao 1.6 Lite | estimate | 128K | $0.02 | $0.04 |
| Baidu ERNIE (百度) | ||||
| ERNIE 4.5 (文心一言) | estimate | 128K | $0.2 | $0.55 |
| ERNIE X1 | estimate | 128K | $0.006 | $0.02 |
| Tencent Hunyuan (腾讯) | ||||
| Hunyuan 2 Pro (混元) | estimate | 128K | $1 | $4 |
| Hunyuan Lite | estimate | 32K | Free | Free |
| iFlytek Spark (讯飞星火) | ||||
| Spark Max / X1 (讯飞星火) | estimate | 128K | $0.5 | $1.7 |
| Spark Lite | estimate | 32K | Free | Free |
| MiniMax (稀宇科技) | ||||
| MiniMax M2.5 | estimate | 197K | $0.29 | $1.18 |
| 01.AI (零一万物) | ||||
| Yi-Lightning (零一万物) | estimate | 128K | $0.4 | $1.2 |
| StepFun (阶跃星辰) | ||||
| Step-3 (阶跃星辰) | estimate | 128K | $0.5 | $1.5 |
| SenseTime (商汤) | ||||
| SenseNova 5.1 (商汤) | estimate | 128K | $0.04 | $0.7 |
| Baichuan (百川智能) | ||||
| Baichuan 4 (百川) | estimate | 128K | $1.2 | $2.8 |
| Kunlun (昆仑万维) | ||||
| SkyClaw 1.0 (昆仑万维) | estimate | 1M | $0.5 | $1.5 |
| Xiaomi MiMo (小米) | ||||
| MiMo V2.5 Pro (小米) | estimate | 1M | $0.44 | $0.87 |
| MiMo V2.5 | estimate | 1M | $0.14 | $0.28 |
| Huawei PanGu (华为云) | ||||
| PanGu 4.7 (盘古) | estimate | 128K | $0.5 | $1.5 |
Dedicated calculators
5GPT-5 calculator
Exact o200k_base counts plus GPT-5.5 / GPT-5 / mini / nano pricing.
4oGPT-4o calculator
GPT-4o and 4o mini token counts with per-call cost estimates.
o1o1 & o3 calculator
Reasoning models: context windows, input and output rates.
CClaude calculator
Opus 5.5, Sonnet 5 and Haiku 4.5 estimates in one place.
GGemini calculator
Gemini 3.1 Pro through Flash-Lite pricing and counts.
LLlama calculator
Open-weight Llama 4 counting for self-hosted cost maths.
DDeepSeek calculator
V4 Pro / Flash and R1 with the CJK-calibrated estimate.
QQwen calculator
Qwen Max / Plus / Turbo counts and list prices.
▢Every model
All 81 models — a dedicated calculator preselected to each one.
▣By provider
List pricing for 23 vendors side by side, with rates per 1M tokens.
Looking for a specific model? Browse all 70 model calculators or compare every provider's pricing. Each page opens with that model already selected.
Developer guides
1.3How many tokens is a word?
Token-to-word ratios for GPT-5, GPT-4o, Claude, Gemini and Llama, with the character ratios behind them.
$AI API pricing in 2026
Side-by-side list prices for every major model, plus how to cut input cost with caching and shorter prompts.
Frequently asked questions
What is an AI token?
A token is the basic unit of text that language models read and generate. For English text, one word is roughly 1.3 tokens (about 4 characters per token). OpenAI bills all API usage in tokens, so understanding token counts helps you estimate costs.
How many tokens is a word?
On average, one English word equals approximately 1.3 tokens with OpenAI's o200k tokenizer. For Chinese text, one character equals about 0.6-1.2 tokens. The exact ratio depends on the model's tokenizer and the text content.
How accurate is this token calculator?
For OpenAI models, the calculator is exact — it uses the actual tiktoken tokenizer (same as OpenAI's servers). For Claude, Gemini, Llama, and other providers, it uses estimate mode (approximately 4 characters per token), accurate within 5-10%.
How much does GPT-4o cost per 1M tokens?
GPT-4o costs $2.50 per 1M input tokens and $10 per 1M output tokens. GPT-4o mini is much cheaper at $0.15 per 1M input and $0.60 per 1M output. All prices are editable in the calculator.
Which models are supported?
We cover 81 models plus a custom-pricing slot: OpenAI GPT-5.5 down to GPT-5 nano, GPT-4o, GPT-4.1, o1/o3/o4 and the embedding models (all exact tiktoken); Anthropic Claude Opus 5.5, Opus 5, Sonnet 5 and Haiku 4.5; Google Gemini 3.1 Pro through Flash-Lite; Meta Llama 4, xAI Grok, Mistral and Amazon Nova; plus DeepSeek, Qwen, GLM, Kimi, Doubao, ERNIE, Hunyuan, Spark, MiniMax, StepFun, SenseTime, Baichuan, Kunlun, MiMo and PanGu.
Is my text uploaded anywhere?
No. All calculations run 100% locally in your browser using JavaScript. Your prompts, code, and documents never leave your computer. You can even disconnect from the internet and the calculator will still work.
Can I use custom pricing?
Yes! You can edit the price per 1M tokens for any model. This is useful for enterprise pricing, custom fine-tunes, or when prices change. Your custom prices are saved in your browser for future sessions.
Why do token counts differ from word counts?
Tokens are not words. Common words like 'the' may be single tokens, while long words are split into multiple tokens. Whitespace is usually attached to the following token. The tokenizer uses Byte-Pair Encoding (BPE) to split text.
Start counting tokens for free
No signup required. Your text never leaves your browser.
Try the calculatorJump straight to a model — each page opens with that model already selected:
GPT-5 · Claude Opus 5.5 · Gemini 3.1 Pro · DeepSeek V4 Pro · Qwen3 Max · Kimi K2.6 · Grok 4.1 · Llama 4 · GLM 5.1 ·
all 81 models · all 23 providers
Building something with these numbers? Embed this calculator on your own site with one line of HTML, or take the 81-model pricing table as JSON under CC BY 4.0.