AI Token Counter
Paste a prompt or document to see how many tokens it uses on GPT, Claude, Gemini, Llama, DeepSeek, Mistral and Qwen models, how much of each context window it fills, and what it would cost through the API. Tokens are counted in your browser with each model’s tokenizer; your text is never sent to a server.
Start typing and token counts and costs for each model appear here.
| Model | Tokens | Context | Input cost | Output cost | Total |
|---|
Costs use standard USD list prices (no batch or caching discounts) multiplied by the number of requests. Context is the share of the context window taken by input plus expected output. Exact same tokenizer, Approx. closely related tokenizer, Estimate no public tokenizer, range from multipliers.
What is a token?
Language models don’t read characters or words directly. A tokenizer first splits text into tokens: common English words are often a single token, while rare words, numbers, code symbols and non-Latin scripts are broken into several pieces. A rough rule of thumb for English is about four characters, or three quarters of a word, per token on modern tokenizers.
Tokens are the unit for everything that matters when you build with an LLM API: what you pay, how much text fits in one request (the context window), and how long an answer can be. Need plain character and word counts instead? Use the character counter.
Why token counts differ between models
Each model family trains its own tokenizer, usually a byte-pair encoding (BPE) or SentencePiece vocabulary built from its training data. Vocabulary size and the languages it saw decide how efficiently text is packed, so the same paragraph can be a few percent apart in English and far more apart in other languages or code.
| Tokenizer | Used by | Vocabulary | Accuracy here |
|---|---|---|---|
| o200k_base | GPT-4o, GPT-4.1, o-series, GPT-5.x | ~200K | Exact (GPT-6: approximate) |
| cl100k_base | GPT-4, GPT-3.5 | ~100K | Exact |
| Llama 4 | Llama 4 Maverick, Scout | 201,135 | Exact |
| Llama 3 | Llama 3.1, 3.3 | 128,256 | Exact |
| Gemma (SentencePiece) | Gemma 3 and 4 (the Gemma 3 report says it shares Gemini 2.0’s tokenizer) | 262,144 | Gemini: approximate |
| Qwen3.8 | Open-weight Qwen3.8; Qwen API models are related | 248,077 | Qwen API: approximate |
| DeepSeek V4 | DeepSeek V4, V4.1 | 129,280 | Exact |
| Mistral Tekken | Mistral Medium 3.5, Small 4, Large 3 | 131,072 | Exact (Large 4: approximate) |
| Claude | All Claude models | Not public | Estimate (see below) |
Vocabulary sizes were read from each tokenizer file, including special tokens (October 19, 2026).
The same sentence in four languages
We wrote one sentence in English and translated it into Spanish, Japanese and Korean, then counted it with the real tokenizers (special tokens excluded). English is the cheapest everywhere; other languages cost up to about twice as much on older tokenizers, and the gap narrows on newer, larger vocabularies.
English (148 characters): “AI models process text by splitting it into small pieces called tokens. Even with the same meaning, the number of tokens varies greatly by language.”
| Tokenizer | English | Spanish | Japanese | Korean |
|---|---|---|---|---|
| OpenAI cl100k_base (GPT-4, 3.5) | 28 | 43 | 61 | 65 |
| OpenAI o200k_base (GPT-5.x) | 28 | 36 | 45 | 38 |
| Llama 3.1 / 3.3 | 28 | 43 | 42 | 41 |
| Llama 4 | 28 | 35 | 34 | 29 |
| DeepSeek V4 | 28 | 41 | 36 | 43 |
| Mistral Tekken | 28 | 36 | 41 | 34 |
| Qwen3.8 | 28 | 36 | 27 | 35 |
| Gemma 4 (Gemini approximation) | 28 | 34 | 27 | 36 |
Counted with tiktoken and Hugging Face tokenizers and cross-checked against this counter on October 19, 2026. One short sentence is only an illustration, but the pattern is typical: if you serve users in several languages, budget tokens per language rather than per character. Anthropic notes that Claude’s tokenizer produces many more tokens than OpenAI’s for non-English text and code, so leave extra headroom there.
How to estimate API cost
Providers bill input (prompt) tokens and output (completion) tokens separately, each at a price per million tokens.
Cost = input tokens × input price ÷ 1,000,000 + output tokens × output price ÷ 1,000,000
- Example: Claude Opus 5.5 ($4 in, $20 out) with 10,000 input and 2,000 output tokens is $0.04 + $0.04 = $0.08 per request, or about $80 for 1,000 requests.
- Long-prompt pricing: some models charge a higher rate for the whole request once the input passes a threshold. Claude Haiku 5.5 moves to $0.50 / $2.50 above 100K prompt tokens, GPT-5.5 and the GPT-6 family bill 2x input and 1.5x output above 272K, and Gemini 3.1 Pro charges $4 / $18 above 200K. The counter applies the right tier automatically.
- Real bills also include chat formatting tokens, system prompts, images, tool definitions and reasoning tokens, and can be lower with prompt caching or batch discounts. This tool counts the text you paste.
Context windows
The context window is the most tokens a model can handle in one request, input and output (and, on some models, reasoning) combined. Most current flagship models offer roughly one million tokens; Llama 4 Scout advertises 10 million, Mistral Medium 3.5 and Small 4 have 256K, and GPT-5.4 mini has 400K with at most 272K of input. When the Context column approaches 100%, split the input or pick a model with a larger window, and remember that longer prompts are also slower and more expensive.
Claude counts are estimates
Anthropic has not published a local tokenizer for current Claude models. Exact counts are only available from the authenticated token counting API (POST /v1/messages/count_tokens), which needs an API key and would mean sending your text away, so this page doesn’t call it. Instead it estimates a range from two facts in Anthropic’s documentation:
- OpenAI’s tokenizer (tiktoken) undercounts Claude by about 15–20% on typical English text, and by much more on code or non-English text.
- The tokenizer introduced with Claude Opus 4.7, used by every Claude model listed here, produces about 1× to 1.35× the tokens of the older Claude tokenizer.
The counter multiplies the o200k count by the ranges below, weighted by the share of non-Latin letters and code-like lines in your text. The multipliers are this site’s own assumptions built on those facts, not official figures.
| Kind of text | Multiplier on o200k |
|---|---|
| English and other Latin-script prose | 1.15–1.6× |
| Code | 1.3–2.0× |
| Korean, Japanese, Chinese and other non-Latin scripts | 1.3–2.5× |
Costs for Claude are shown as a range too. Budget with the upper end, and use the count_tokens API when you need the exact number.
API price list
Standard prices from each provider’s official pricing page, in USD per million tokens, without batch or caching discounts. Prices change often, so confirm on the provider’s page before you commit.
| Model | Input | Output | Context | Notes |
|---|---|---|---|---|
| OpenAI | ||||
| GPT-6 Astra | $10 | $50 | 1.05M | The GPT-6 tokenizer is not yet published in tiktoken, so o200k_base is used as an approximation. Requests over 272K input tokens are billed at 2x input and 1.5x output for the whole request. |
| GPT-6.1 Sol | $2 | $10 | 1.05M | The GPT-6 tokenizer is not yet published in tiktoken, so o200k_base is used as an approximation. Requests over 272K input tokens are billed at 2x input and 1.5x output for the whole request. |
| GPT-6 Luna | $0.10 | $0.50 | 1.05M | The GPT-6 tokenizer is not yet published in tiktoken, so o200k_base is used as an approximation. Requests over 272K input tokens are billed at 2x input and 1.5x output for the whole request. |
| GPT-5.5 | $5 | $30 | 1.05M | Requests over 272K input tokens are billed at 2x input and 1.5x output for the whole request. |
| GPT-5.4 mini | $0.75 | $4.50 | 400K | |
| GPT-3.5 Turbo | $0.50 | $1.50 | 16K | Legacy model, included to compare the older cl100k_base tokenizer (GPT-4 / GPT-3.5). |
| Anthropic | ||||
| Claude Fable 5.1 | $10 | $50 | 1M | |
| Claude Opus 5.5 | $4 | $20 | 1M | |
| Claude Sonnet 5.5 | $2 | $10 | 1M | |
| Claude Haiku 5.5 | $0.10 | $0.50 | 1M | Requests whose prompt exceeds 100K tokens are billed at $0.50 input / $2.50 output. |
| Claude Opus 5 | $5 | $25 | 1M | |
| Claude Sonnet 5 | $2 | $10 | 1M | |
| Gemini 4 Argon | $2 | $10 | 1.05M | Approximated with the Gemma tokenizer. Scheduled to rise to $4 / $20 on December 1, 2026. |
| Gemini 3.8 Flash | $0.75 | $3.75 | 1.05M | Approximated with the Gemma tokenizer. Scheduled to rise to $1.50 / $7.50 on January 1, 2027. |
| Gemini 3.5 Flash-Lite | $0.30 | $2.50 | 1.05M | Approximated with the Gemma tokenizer. |
| Gemini 3.1 Pro (Preview) | $2 | $12 | 1.05M | Approximated with the Gemma tokenizer. Prompts over 200K tokens: $4 / $18. |
| Meta | ||||
| Llama 4 Maverick | Varies by host | 1M | Llama has no single list price; it depends on the host (check your provider). | |
| Llama 4 Scout | Varies by host | 10M | Llama has no single list price; it depends on the host (check your provider). | |
| Llama 3.3 70B | Varies by host | 128K | Llama has no single list price; it depends on the host (check your provider). | |
| DeepSeek | ||||
| DeepSeek V4.1 Flash | $0.30 | $1.20 | 1M | API model deepseek-flash runs DeepSeek-V4.1-Flash-1017. Peak-hour price (01:00-04:00 and 06:00-10:00 UTC, weekdays); off-peak is half. Input is cache-miss. |
| DeepSeek V4 Pro | $1.32 | $3.96 | 1M | API model deepseek-v4-pro runs DeepSeek-V4-Pro-0813. Peak-hour price (01:00-04:00 and 06:00-10:00 UTC, weekdays); off-peak is half. Input is cache-miss. |
| Mistral AI | ||||
| Mistral Large 4 | $0.68 | $2.09 | 1M | Public preview. Sale price; list price is $1.36 / $4.18 (no end date given). Approximated with the Mistral Tekken tokenizer. |
| Mistral Medium 3.5 | $1.50 | $7.50 | 256K | |
| Mistral Small 4 | $0.15 | $0.60 | 256K | |
| Qwen (Alibaba Cloud) | ||||
| Qwen3.8 Max | $2 | $6 | 1M | Approximated with the open-weight Qwen3.8 tokenizer. International (Singapore) region price. |
| Qwen3.7 Plus | $0.40 | $1.60 | 1M | Approximated with the open-weight Qwen3.8 tokenizer. International (Singapore) region price. Over 256K input tokens: $1.20 / $4.80. |
| Qwen3.8 Flash | $0.15 | $0.47 | 1M | Approximated with the open-weight Qwen3.8 tokenizer. International (Singapore) region price. |
Sources (official pricing pages, checked 2026-10-19):
FAQ
Is my text uploaded?
No. Tokenization runs in your browser. The page downloads only the price list and tokenizer files (from the jsDelivr CDN and Hugging Face); the text you type is never sent to our server or to any AI provider, and it isn’t stored. Only your model selection is remembered in this browser for next time.
Why doesn’t this match the usage reported by the API?
A real request adds chat formatting tokens (roles and separators), the system prompt, tool definitions, images and reasoning tokens. This counter measures the text itself, so billed usage is usually somewhat higher.
What do Exact, Approx. and Estimate mean?
Exact means the count comes from the same public tokenizer file the model uses. Approx. means the model’s own tokenizer isn’t published, so a closely related one is used (Gemma for Gemini, open-weight Qwen3.8 for Qwen API models, o200k_base for GPT-6); treat these as close approximations, not guaranteed matches. Estimate is used for Claude, where no comparable public tokenizer exists.
Why do Llama, DeepSeek, Mistral and Qwen take a moment to load?
Their tokenizer files (about 6–21 MB) are downloaded from Hugging Face the first time you select them, then served from your browser cache. On a metered connection, select only the models you need.