Skip to content
Convertto

Token Counter for GPT, Claude, Gemini and Llama

Count tokens with the real BPE vocabulary, see every token coloured in place, and compare the count across models.

This token counter runs the real byte-pair-encoding vocabulary in your browser: o200k_base for GPT-4o and later, cl100k_base for GPT-4 and the embedding models. It shows the exact token count, every individual token highlighted in place, characters per token, and the same text measured against Claude, Gemini and Llama. Nothing you paste is uploaded.

Runs in your browser
Exact for
o200k_base and cl100k_base — the published OpenAI vocabularies
Estimated for
Claude, Gemini, Llama, Mistral and DeepSeek — no published vocabulary
Typical English
~4 characters per token
Typical JSON or code
~2.5 characters per token
Privacy
Runs entirely in your browser — nothing is uploaded
Cost
Free, unlimited, no sign-up

Frequently asked questions

Why is the token count different from characters ÷ 4?

Because ÷ 4 is an average over English prose and nothing else. Whitespace-heavy code, JSON keys, UUIDs, base64 and any non-Latin script all tokenise far more densely — 2 to 2.5 characters per token is common — so the shortcut can under-count a payload by 40%.

Is the Claude token count exact?

No, and it says so. Anthropic does not publish Claude's vocabulary, so the figure here is a calibrated estimate — usually within a few percent on prose, less accurate on code. For a billing-exact number call the count_tokens endpoint, which is free.

Does my text get uploaded?

No. The vocabulary file is downloaded to your browser and the encoding runs locally. That matters here more than on most tools, because the thing people most want to count is a production prompt.

Why do two models give different counts for the same text?

Each model family trained its own vocabulary. A word that is one token in o200k might be three in an older 32k vocabulary, and the same document can differ by 30% between tokenisers — which is why a prompt that fits one model's context window may not fit another's.

How to use the llm token counter

  1. 1Enter or paste your text.
  2. 2Choose the tokeniser.
  3. 3Turn "Show every token" on or off as needed.
  4. 4Press Run, then download the result when it is ready.

Sources & specifications

Embed this tool

Put the working llm token counter on your own site. It runs in your visitors' browsers exactly as it does here — free, no account, nothing uploaded.

Share this tool

Last updated

More ai & llm tools