Skip to content

Claude token counter

Tokens and prompt cost for Claude Sonnet 5.5, Opus 5.5, Haiku 5.5 and Fable 5.2.

Try a sample:
ModelTokensPrompt costContext used

Counts appear here as you type.

Choose models

Cloud models

Local models

Work out the monthly cost

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.

Compare all 24 EU languages

Built for AI agents too

Agents call the same tools over MCP or a JSON API: count tokens, compare prices, check context windows.

Connect an agent

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.