Claude token counter
Tokens and prompt cost for Claude Sonnet 5.5, Opus 5.5, Haiku 5.5 and Fable 5.2.
Counts appear here as you type.
Choose models
Cloud models
Local models
Exact counts for Claude and Gemini
Their tokenizers are not public. We can ask the vendors’ own token endpoints. Your text goes through our server to Anthropic and Google for this one count and is not stored.
* OpenAI has not published the GPT-6 tokenizer. These rows use o200k_base, the tokenizer of GPT-5 and GPT-4o.
Estimates scale the OpenAI count by a factor for that tokenizer. The band shows how far off they can be.
Anthropic does not publish the Claude tokenizer. Claude 4.7 and later models use a newer tokenizer that produces about 30 % more tokens than earlier Claude models for the same text, so counters built on the old rules run low.
This page shows a labelled estimate straight away. Press the exact-count button and the number comes from Anthropic’s own token-counting endpoint instead.
How counting works
Exact where it can be
OpenAI, DeepSeek, Qwen, Mistral, Llama and Gemma publish their tokenizers. We run them in your browser and test them against the reference implementations.
Honest where it cannot
Claude, Gemini and Grok keep their tokenizers private. You get an estimate with an error band, and the exact number on request from the vendor’s own endpoint.
Private by default
Your text is counted on your device. Nothing is uploaded unless you press the exact-count button.
Your language changes the bill
The same document needs 1.74× the tokens in Slovak, 2.00× in Hungarian and 1.27× in German compared with English on the OpenAI tokenizer.
Built for AI agents too
Agents call the same tools over MCP or a JSON API: count tokens, compare prices, check context windows.
Questions
What is a token?
A token is a piece of text that a language model reads or writes: a short word, part of a longer word, a punctuation mark. Models bill and limit by tokens, not by characters or words.
Why do models give different counts for the same text?
Each model family has its own tokenizer with its own vocabulary. The same sentence can be 50 tokens on one model and 80 on another, so the lowest price per token is not always the lowest bill.
Are the counts exact?
For models with a public tokenizer, yes: it is the count the model sees for plain text. Chat formatting adds a few tokens per message. For Claude, Gemini and Grok the count is an estimate unless you ask for the exact number.
Is my text stored?
No. Counting runs in your browser. If you ask for an exact vendor count, the text passes through our server to the vendor and is not kept or logged.