Tokenizer Visualizer
Paste text and see exactly which tokens a language model splits it into, with their IDs. Check why Spanish costs more tokens than English.
0
Tokens
95
Characters
11
Words
—
Characters per token
Loading the tokenizer…
Why this matters if you write in Spanish
Tokenisers were trained mostly on English text, so frequent English words fit in one token while Spanish ones get split into pieces. The same content costs more tokens in Spanish than in English — and tokens are what you are billed for. Press the two examples above and compare.
The o200k_base tokeniser, used by current OpenAI models. Anthropic and Google use their own, so counts vary a little, but the behaviour you see here is the same.
Everything happens in your browser. Your text is never sent to any server.
What this tool does
You paste text and see exactly which tokens the model splits it into, each in a different colour with its numeric identifier. It is not an estimate: it is the same tokeniser current OpenAI models use, running in your browser.
If what you need is the cost in money, that is the token counter. This is for understanding why that number is what it is.
What a token actually is
Neither a letter nor a word: a frequent fragment the tokeniser learned from its training corpus. The practical rules become obvious as soon as you start playing:
- A common English word fits in a single token.
- A rare, technical or foreign word splits into several.
- The space attaches to the start of the following token, not the end of the previous one. That is why the text view shows
·wordwith the interpunct in front: that space is part of the token. - Long numbers, identifiers and URLs get chopped up mercilessly.
That last rule explains several oddities at once: a UUID that looks like a short piece of data to you can cost twenty tokens, and a JSON blob with long keys repeated hundreds of times is far more expensive than it looks.
Spanish costs more, and you can see it
This is the main reason the tool exists, and it is easy to verify: press the two example buttons and compare the counters.
Tokenisers were trained overwhelmingly on English text. The consequence is that frequent English words get their own token, while Spanish ones — with their accents, longer endings and smaller presence in the corpus — are split into pieces.
An example you will see in the tool itself: tokenización splits into token + ización. prueba is one whole token, but internacionalización is several.
Translated into billing: the same content in Spanish consumes more tokens than in English, and you pay for that twice — in the prompt you send and in the response you get back. If you are building anything with volume on a paid API, that is a real difference, not a curiosity.
There is no trick to dodge it entirely, but knowing it changes decisions: where to trim context, whether summarising before sending is worth it, and how optimistic your cost estimate is if you calculated it with English text.
Why models fail at counting letters
The classic question — “how many r’s are in strawberry?” — is answered wrong with surprising frequency, and here you can see why: the model never saw the individual letters. It saw two or three fragments. Asking it to count characters is asking it to reason about something absent from its input representation.
The same goes for reversing words, counting syllables or wordplay. It is not that the model is stupid at those: it is looking at something else.
Which tokeniser this is
o200k_base, the one behind current OpenAI models. The count is exact for them.
Anthropic and Google use their own tokenisers and do not publish an equivalent local implementation, so their figures vary a little — the token counter applies an adjustment factor for those cases and says so. But the behaviour you observe here is common to all of them: what splits and what does not, the leading space, and Spanish coming out more expensive.
What it does not do
- It calls no API. The tokeniser downloads to your browser and the computation happens there; you can confirm it in the network tab.
- It does not calculate prices. That is the token counter, which also maintains the pricing table.
- It does not count image or audio tokens. Multimodal models bill those separately and with different logic.
Frequently asked questions
What exactly is a token?
It is the unit a model reads and writes in. They are neither letters nor words: they are frequent fragments the tokeniser learned from its training corpus. A common word usually fits in one token, a rare one splits into several, and spaces normally attach to the start of the following token. That is why the count matches neither characters nor words.
Why does Spanish use more tokens than English?
Because tokenisers were trained mostly on English text, so frequent English words get their own token while Spanish ones are chopped up. Translated into billing: the same content costs more in Spanish than in English, both in the prompt and in the response. You can check it with the tool's two example buttons.
Does it work for Claude and Gemini or only OpenAI?
The tokeniser used here is o200k_base, the one behind current OpenAI models, so the count is exact for them. Anthropic and Google use their own tokenisers and do not publish an equivalent local implementation, so their numbers vary a little. The behaviour you observe — what splits and what does not, and that Spanish costs more — is the same across all of them.
What is the point of seeing the tokens rather than just counting them?
To understand where the cost comes from and why a model sometimes behaves oddly. Seeing an identifier, a URL or a JSON blob split into ten tokens explains why an apparently short prompt is expensive. It also clarifies the classic failures at counting letters or splitting words: the model never saw the individual letters, it saw those fragments.
Is my text sent to a server?
No. The tokeniser is downloaded to your browser and all the computation happens there. There is no call to OpenAI's API or any other, which you can confirm in the network tab of your developer tools.
Reviews & ratings
No reviews yet. Be the first to leave one!
Related guides
Blog tutorials where this tool comes in handy.
Related tools
Others from the catalogue that pair well with this one.