Claude token counter
There is no public Claude tokenizer. Any tool that counts Claude tokens in your browser is estimating. This counter asks Anthropic's own count_tokens endpoint, which is free and returns the exact number the API bills.
Why there is no "Claude tokenizer" download
OpenAI open-sourced its tokenizers, so exact GPT counting can run locally. Anthropic has not published a tokenizer for any current Claude model. The supported way to count is the count_tokens API endpoint: you send the text, Anthropic returns the token count, and the endpoint is free and rate-limited separately from generation. Sites claiming "99% accurate" in-browser Claude counts cannot verify that claim against anything, because the reference implementation only exists behind the API.
One prompt, different counts per Claude generation
Claude's tokenizer changed between model generations, which means the same text produces different token counts on different Claude models:
| Model family | Tokenizer | Effect on identical text |
|---|---|---|
| Claude Sonnet 4.6 and older 4.x models | Older generation | Baseline counts |
| Claude Opus 4.7 and later, Opus 5, Fable 5 | Newer generation | Roughly 1x to 1.35x the baseline, varies by content |
| Claude Sonnet 5 vs Sonnet 4.6 | Newer vs older | About 30% more tokens on identical text |
Verified 2026-08-10 against Anthropic's migration documentation.
This has a direct billing consequence: moving a workload from Sonnet 4.6 to Sonnet 5 changes your cost twice, once through the price per token and once through the tokens per prompt. Budgeting from a single "Claude tokens" number is wrong by construction. Count against the model you will actually call.
Practical notes
- Counts are per model. Pick the model you will run in production, not the family.
- Input and output bill at different rates. See Claude API pricing for current numbers and a cost calculator.
- Long prompts fit comfortably: current Claude models take up to a million tokens of context. Details at Claude context windows.
- If your prompt has a large stable prefix, prompt caching changes the economics more than any other lever.
Other counters: OpenAI · Kimi · DeepSeek · methods in how we count