Token Counter
Count tokens and estimate API costs for GPT, Claude, Gemini, Grok and more.
Prices last updated:
Paste your prompt or text
- Tokens (o200k, GPT-4o/5)
- 0
- Tokens (cl100k, GPT-4)
- 0
- Characters
- 0
- Words
- 0
| Provider | Model | Input /1M | Cached /1M | Output /1M | Input tokens | Input cost | Cached input cost | Output cost | Total |
|---|---|---|---|---|---|---|---|---|---|
| OpenAI | gpt-6-astra | $10 | $1 | $50 | 0 | $0 | $0 | $0.0250 | $0.0250 |
| OpenAI | gpt-6.1-sol | $2 | $0.1 | $10 | 0 | $0 | $0 | $0.005000 | $0.005000 |
| OpenAI | gpt-6-sol | $2 | $0.2 | $10 | 0 | $0 | $0 | $0.005000 | $0.005000 |
| OpenAI | gpt-6-luna | $0.1 | $0.01 | $0.5 | 0 | $0 | $0 | $0.000250 | $0.000250 |
| OpenAI | gpt-5.6-sol | $4 | $0.4 | $20 | 0 | $0 | $0 | $0.0100 | $0.0100 |
| OpenAI | gpt-5.6-terra | $2 | $0.2 | $12 | 0 | $0 | $0 | $0.006000 | $0.006000 |
| OpenAI | gpt-5.6-luna | $0.2 | $0.02 | $1.2 | 0 | $0 | $0 | $0.000600 | $0.000600 |
| OpenAI | gpt-5.5 | $5 | $0.5 | $30 | 0 | $0 | $0 | $0.0150 | $0.0150 |
| OpenAI | gpt-5.4 | $2.5 | $0.25 | $15 | 0 | $0 | $0 | $0.007500 | $0.007500 |
| OpenAI | gpt-5.4-mini | $0.75 | $0.075 | $4.5 | 0 | $0 | $0 | $0.002250 | $0.002250 |
| OpenAI | gpt-5.4-nano | $0.2 | $0.02 | $1.25 | 0 | $0 | $0 | $0.000625 | $0.000625 |
| OpenAI | gpt-5 | $1.25 | $0.125 | $10 | 0 | $0 | $0 | $0.005000 | $0.005000 |
| OpenAI | gpt-5-mini | $0.25 | $0.025 | $2 | 0 | $0 | $0 | $0.001000 | $0.001000 |
| OpenAI | gpt-5-nano | $0.05 | $0.005 | $0.4 | 0 | $0 | $0 | $0.000200 | $0.000200 |
| OpenAI | gpt-4.1 | $2 | $0.5 | $8 | 0 | $0 | $0 | $0.004000 | $0.004000 |
| OpenAI | gpt-4.1-mini | $0.4 | $0.1 | $1.6 | 0 | $0 | $0 | $0.000800 | $0.000800 |
| OpenAI | gpt-4.1-nano | $0.1 | $0.025 | $0.4 | 0 | $0 | $0 | $0.000200 | $0.000200 |
| OpenAI | gpt-4o | $2.5 | $1.25 | $10 | 0 | $0 | $0 | $0.005000 | $0.005000 |
| OpenAI | gpt-4o-mini | $0.15 | $0.075 | $0.6 | 0 | $0 | $0 | $0.000300 | $0.000300 |
| OpenAI | o3 | $2 | $0.5 | $8 | 0 | $0 | $0 | $0.004000 | $0.004000 |
| OpenAI | o3-pro | $20 | – | $80 | 0 | $0 | – | $0.0400 | $0.0400 |
| OpenAI | o4-mini | $1.1 | $0.275 | $4.4 | 0 | $0 | $0 | $0.002200 | $0.002200 |
| Anthropic | Claude Fable 5.1 | $10 | $0.25 | $50 | 0* | $0 | $0 | $0.0250 | $0.0250 |
| Anthropic | Claude Opus 5.5 | $4 | $0.2 | $20 | 0* | $0 | $0 | $0.0100 | $0.0100 |
| Anthropic | Claude Opus 5 | $5 | $0.5 | $25 | 0* | $0 | $0 | $0.0125 | $0.0125 |
| Anthropic | Claude Opus 4.8 | $5 | $0.5 | $25 | 0* | $0 | $0 | $0.0125 | $0.0125 |
| Anthropic | Claude Sonnet 5.5 | $2 | $0.1 | $10 | 0* | $0 | $0 | $0.005000 | $0.005000 |
| Anthropic | Claude Sonnet 5 | $2 | $0.2 | $10 | 0* | $0 | $0 | $0.005000 | $0.005000 |
| Anthropic | Claude Sonnet 4.6 | $3 | $0.3 | $15 | 0* | $0 | $0 | $0.007500 | $0.007500 |
| Anthropic | Claude Haiku 5.5 (<=100K prompt) | $0.1 | $0.01 | $0.5 | 0* | $0 | $0 | $0.000250 | $0.000250 |
| Anthropic | Claude Haiku 5.5 (>100K prompt) | $0.5 | $0.05 | $2.5 | 0* | $0 | $0 | $0.001250 | $0.001250 |
| Anthropic | Claude Haiku 4.5 | $1 | $0.1 | $5 | 0* | $0 | $0 | $0.002500 | $0.002500 |
| gemini-4-argon | $2 | $0.1 | $10 | 0* | $0 | $0 | $0.005000 | $0.005000 | |
| gemini-3.8-flash | $0.75 | $0.075 | $3.75 | 0* | $0 | $0 | $0.001875 | $0.001875 | |
| gemini-3.6-flash | $0.75 | $0.075 | $3.75 | 0* | $0 | $0 | $0.001875 | $0.001875 | |
| gemini-3.5-flash-lite | $0.3 | $0.03 | $2.5 | 0* | $0 | $0 | $0.001250 | $0.001250 | |
| gemini-3.1-flash-lite | $0.25 | $0.025 | $1.5 | 0* | $0 | $0 | $0.000750 | $0.000750 | |
| gemini-3.1-pro-preview | $2 | $0.2 | $12 | 0* | $0 | $0 | $0.006000 | $0.006000 | |
| gemini-2.5-pro | $1.25 | $0.125 | $10 | 0* | $0 | $0 | $0.005000 | $0.005000 | |
| gemini-2.5-flash | $0.3 | $0.03 | $2.5 | 0* | $0 | $0 | $0.001250 | $0.001250 | |
| gemini-2.5-flash-lite | $0.1 | $0.01 | $0.4 | 0* | $0 | $0 | $0.000200 | $0.000200 | |
| xAI | grok-4.7 | $2 | $0.5 | $6 | 0* | $0 | $0 | $0.003000 | $0.003000 |
| xAI | grok-4.6 | $2 | $0.5 | $6 | 0* | $0 | $0 | $0.003000 | $0.003000 |
| xAI | grok-4.3 | $1.25 | $0.2 | $2.5 | 0* | $0 | $0 | $0.001250 | $0.001250 |
| xAI | grok-4.20-0309-reasoning | $1.25 | $0.2 | $2.5 | 0* | $0 | $0 | $0.001250 | $0.001250 |
| xAI | grok-build-0.1 | $1 | $0.2 | $2 | 0* | $0 | $0 | $0.001000 | $0.001000 |
| DeepSeek | deepseek-flash (V4.1-Flash) | $0.3 | $0.006 | $1.2 | 0* | $0 | $0 | $0.000600 | $0.000600 |
| DeepSeek | deepseek-v4-pro | $1.32 | $0.044 | $3.96 | 0* | $0 | $0 | $0.001980 | $0.001980 |
| Mistral | Mistral Large | $0.5 | – | $1.5 | 0* | $0 | – | $0.000750 | $0.000750 |
| Meta (via Together AI) | Llama 3.3 70B | $1.04 | – | $1.04 | 0* | $0 | – | $0.000520 | $0.000520 |
| Meta (via Together AI) | Llama 3 8B Instruct Lite | $0.14 | – | $0.14 | 0* | $0 | – | $0.000070 | $0.000070 |
- Google gemini-4-argon: from Dec 1, 2026: $4 input / $20 output per 1M, cache $0.20
- Google gemini-3.8-flash: from Jan 1, 2027: $1.50 input / $7.50 output per 1M, cache $0.15
- Google gemini-3.6-flash: from Jan 1, 2027: $1.50 input / $7.50 output per 1M, cache $0.15
* Estimated with the o200k tokenizer (or ~4 chars/token, whichever is higher). Values marked ~ are quick estimates (≈4 chars/token) while the exact tokenizer loads. Hover a row for provider notes (English).
AI Token Counter & Cost Calculator
Free AI token counter: paste text to count tokens, characters and words, and compare API costs across GPT, Claude, Gemini, Grok, DeepSeek and more. Runs in your browser.
FAQ
What is a token?
A token is a chunk of text a language model processes. In English, one token is roughly 4 characters or about 0.75 words.
Are the token counts exact?
Counts for OpenAI models use the official tokenizer encodings (o200k_base / cl100k_base) and are exact. Other providers use different tokenizers, so their counts are estimates.
Is my text sent anywhere?
No. Tokenization and cost calculation run entirely in your browser. Nothing is uploaded.
How are costs calculated?
Cost = input tokens × input price + expected output tokens × output price, using published USD prices per 1 million tokens. Cached-input cost applies when the provider serves your prompt from cache.
How current are the prices?
Prices were last checked on October 14, 2026. Always confirm with the provider before budgeting.
What this tool does
Paste a prompt, pick a model, and the calculator shows how many tokens your text uses and what a request would cost at that model's published API price. It runs entirely in your browser.
Model prices in the table were checked on the providers' official pricing pages on Oct 14, 2026. Confirm current rates on the linked provider pages before budgeting.
What is a token?
Language models do not read words or characters. They read tokens: small chunks of text taken from a fixed vocabulary. A token can be a whole common word ("the"), part of a longer word ("calcul" + "ator"), a space plus a word, a number fragment, or a single punctuation mark.
A few practical rules of thumb for English text:
- One token is roughly four characters, or about three quarters of a word.
- Common words are usually one token. Rare words, names, and technical terms often split into several.
- Code, JSON, URLs, and long numbers tend to use more tokens than plain prose of the same length.
- Many non-English languages, especially those with non-Latin scripts, use more tokens per word than English.
These are averages. Only the model's real tokenizer gives the exact number.
Why token counts differ between providers
Every provider trains its own tokenizer, so the same sentence can produce a different token count on each model.
OpenAI: exact counts
OpenAI publishes its tokenizers. Newer OpenAI models use the o200k encoding, and older ones such as the GPT-3.5 and GPT-4 generations use cl100k. ToolOven runs these encodings directly in your browser, so OpenAI counts are exact for the text you paste.
Anthropic, Google, Mistral and others: estimates
Other providers either do not publish their tokenizers or only offer counting through their own APIs. For these models the tool gives an estimate and marks it clearly. Estimates are usually close enough for budgeting. If you need exact numbers, use the provider's own token-counting endpoint or check the usage figures returned with each API response.
Hidden tokens you don't see
Your bill can include tokens that never appear in your prompt box:
- System prompts and instructions sent with every request.
- Conversation history that chat apps resend on each turn.
- Tool or function definitions and structured-output schemas.
- Reasoning tokens on "thinking" models, which are usually billed as output even when hidden.
Count everything your application actually sends, not just the user's message.
How API pricing works
Most providers charge separately for three kinds of tokens, each quoted per 1 million tokens (1M):
- Input: the tokens you send (prompt, instructions, history, documents).
- Cached input: input the provider has already processed recently and can reuse, charged at a much lower rate. The rules vary: some providers cache automatically, others need you to mark content for caching, and some charge extra to write to the cache.
- Output: the tokens the model generates. Output is almost always the most expensive per token.
The formula is simple:
Cost = (uncached input tokens ÷ 1,000,000 × input price) + (cached tokens ÷ 1,000,000 × cached price) + (output tokens ÷ 1,000,000 × output price)
Multiply by the number of requests to get a monthly or per-feature estimate.
Worked example
Say you run a support assistant that handles 10,000 requests a month. Each request sends 2,000 input tokens and gets back 500 output tokens.
Monthly totals: 20,000,000 input tokens and 5,000,000 output tokens.
Using prices checked Oct 14, 2026:
OpenAI gpt-5-mini ($0.25 input, $0.025 cached, $2 output per 1M):
- Input: 20M × $0.25 = $5.00
- Output: 5M × $2.00 = $10.00
- Total: $15.00 per month
Anthropic Claude Opus 5 ($5 input, $0.50 cached hit, $25 output per 1M):
- Input: 20M × $5 = $100.00
- Output: 5M × $25 = $125.00
- Total: $225.00 per month
Now add caching. If 1,500 of the 2,000 input tokens are a fixed system prompt that gets cached, gpt-5-mini costs:
- Cached: 15M × $0.025 = $0.375
- Uncached: 5M × $0.25 = $1.25
- Output: 5M × $2.00 = $10.00
- Total: about $11.63 per month, roughly 22% less.
Model choice can change the bill more than tenfold, and output length often drives the total.
(Anthropic also charges for writing to the cache, at 1.25× the input price for a 5-minute cache or 2× for 1 hour, so real savings depend on how often the cache is reused.)
Tips to cut your API costs
- Start with the smallest model that does the job. Test a "mini" or "nano" tier first and only move up if quality falls short.
- Cap output length. Set a maximum output token limit and ask for concise answers or a fixed format.
- Use caching for repeated content. Put stable instructions and reference documents at the start of the prompt so they can be cached.
- Trim conversation history. Summarize older turns instead of resending the full chat every time.
- Shorten system prompts. Long instruction blocks are paid on every single request.
- Use batch processing when you can wait. Several providers offer cheaper rates for non-urgent batch jobs. Check each provider's pricing page.
- Watch reasoning settings. On thinking models, lower reasoning effort can sharply cut hidden output tokens.
- Measure real usage. Compare this calculator's estimate with the usage numbers in your API responses and adjust.
Remember that model fees are only part of the bill: if you're building an app around these models, budget for the server or cloud platform that runs it too. And if your project turns text into speech, check that provider's pricing separately, because voice APIs usually charge by characters or audio minutes rather than tokens.
Frequently asked questions
How many words is 1,000 tokens?
For typical English prose, about 750 words. Code, data, and other languages usually fit fewer words into the same number of tokens.
Are the token counts exact?
For OpenAI models, yes. The tool uses OpenAI's published o200k and cl100k encodings. For other providers the count is an estimate and is marked as one.
Is my text sent anywhere?
No. Tokenizing and cost calculation happen entirely in your browser. Nothing you paste is uploaded.
Why is output more expensive than input?
Generating text one token at a time takes more compute than reading a prompt, so providers price output higher. That's why limiting response length is one of the most effective ways to save money.
How current are the prices?
Prices were checked on official provider pages on Oct 14, 2026, and the date is shown on the table. Providers change prices and add promotional or long-context rates, so always confirm on the linked source before budgeting.
Does the calculator include taxes, batch discounts, or long-context surcharges?
No. It uses standard listed rates. Some models charge more for very long prompts, and batch or priority tiers have different prices. See the notes and source link for each model.