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 familyTokenizerEffect on identical text
Claude Sonnet 4.6 and older 4.x modelsOlder generationBaseline counts
Claude Opus 4.7 and later, Opus 5, Fable 5Newer generationRoughly 1x to 1.35x the baseline, varies by content
Claude Sonnet 5 vs Sonnet 4.6Newer vs olderAbout 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

Other counters: OpenAI · Kimi · DeepSeek · methods in how we count