gizmobench

Token Counter

Estimate how many tokens a piece of text will cost across Claude, GPT and Llama tokenisers, and see where the splits fall. It is an estimate and says so plainly, but it runs entirely in your browser, which matters when the text you are measuring is a prompt.

tokens≈ 0 tokens

Boundaries appear here as you type. Each mark shows where a tokeniser would cut.

Tokeniser
Tokens
0
Characters
0
Words
0
Chars / token
Close estimate. This is an estimate, not a real count of Claude tokens. It runs a heuristic tokeniser in your browser (your text is never uploaded) so it does not have Claude's own vocabulary to consult. For ordinary prose it usually lands within about 10% of the real figure, and it is tuned to read a little high rather than a little low: the safer way to be wrong when you are budgeting against a context window. Check with the provider's own counter before you rely on it at a hard limit.
  • ClaudeClaude (Opus, Sonnet, Haiku)
    0 tokens
  • GPT-4oGPT-4o, GPT-4.1, o-series (o200k)
    0 tokens
  • Llama 3Llama 3 / 3.1 / 3.3 (128k)
    0 tokens

Anthropic has never published Claude's vocabulary, so this is the loosest of the three. Calibrated against measured counts: Claude typically spends a few per cent more tokens on English than GPT-4o does.

Why this one runs locally and others do not. Most token counters POST your prompt to a server. A prompt is often the most sensitive text a developer handles: unreleased copy, customer data, internal strategy. The tokeniser here is bundled into the page.

Common questions

What is a token?
The unit a language model actually reads. Tokens are sub-word fragments, not words or characters: common words are usually one token, rarer words split into several, and whitespace and punctuation attach to neighbouring fragments. English averages roughly four characters per token, so a thousand-word document lands somewhere near 1,300 tokens.
How accurate is this estimate?
It depends on the text, and the tool tells you which band you are in rather than quoting one number. Ordinary prose usually lands within about 10% of the real figure. Code, URLs and encoded blobs such as base64 or JWTs drift further, so treat those as within roughly 25%. Text heavy in CJK, combining marks or emoji is where a heuristic drifts most and the figure can be off by half in either direction. The estimate is tuned to read slightly high rather than low, which is the safer way to be wrong when budgeting against a context window.
Why not just use the official tokeniser?
Because running the real BPE vocabulary in the browser means shipping several megabytes per model family, and the results still drift as vendors update models. The honest trade is a small, fast, local estimate that states its error bar, rather than a precise-looking number from a server you had to send your prompt to.
Why does the tool refuse to claim exact counts?
Because it would be false, and a tool that overstates its precision is worse than no tool. Every result is labelled an estimate with its expected error range. If you need an exact count, the model provider's own API returns one for the specific model version you are calling.
Does my prompt get sent anywhere?
No, and this is the main reason to use a local counter. A prompt is frequently the most sensitive text a developer handles: unreleased copy, internal strategy, customer records pasted in for summarisation. Most token counters POST it to a backend. This one loads the page once and computes locally; check your network tab and you will see nothing leave.
How are emoji and non-English text counted?
Emoji are priced per visible glyph, so a multi-codepoint family emoji counts once rather than as its seven component code points. That is deliberate and it reads low against a real tokeniser, which is stated in the accuracy note whenever your text is emoji-heavy. CJK characters are charged at roughly one token each, which is this tool's calibration rather than a claim about any vendor's actual vocabulary. Line endings are normalised, so identical text scores identically whether it uses Windows or Unix line breaks.

An estimate, and the tool tells you which confidence band your text falls in: about 10% for prose, wider for code and much wider for CJK or emoji. Check the provider’s own counter before a hard limit.