How AI reads text, shown on a live tokenizer you can type into
Language models never see your words. They see , the puzzle pieces text gets cut into before a model reads it. Type anything below and watch a real slice your sentence the same way the tokenizers inside ChatGPT, Claude and Gemini do.
New to the vocabulary? Tap any dotted term for a definition, or .
0tokens
0characters
0words
0
Every entry in the tokenizer's vocabulary has a fixed serial number, its token ID. This vocabulary has 12,000 entries, so IDs run 0–11,999 (computers count from zero, so the 12,000th entry is #11,999). The model never sees your text. The tokenizer hands it this list of numbers, and all the math happens on those. Lower IDs were learned earlier, and the first 256 are the raw bytes themselves.Spaces don't separate tokens here. The space before a word is part of its token. The tokenizer learned "·cat" (space included) because that's how words usually appear. Bare "cat" at a sentence start or after a quote mark is a different vocabulary entry with a different ID. That's why the same word can tokenize differently depending on where it sits, and why spaces never cost their own token.↑ Click any token to inspect it
Token ID This token's position in the 12,000-entry vocabulary. IDs run 0–11,999 because computers count from zero. The model receives these numbers, never the text itself.
—
Characters
—
Bytes
—
Watch a word get built BPE = Byte Pair Encoding, the algorithm that decides where text gets cut. It runs in two phases. Training (once, long ago): scan a mountain of text, repeatedly glue together the most common adjacent pair, and write each merge down as a numbered rule. Tokenizing (every time you type): the rules are frozen, nothing new is learned, and they replay in priority order. That replay is what you're clicking through below.
starts from single characters and repeatedly glues together the pair it saw most often during . The glowing pair is the one the tokenizer wants to merge next. Click it to glue the pieces together, one rule at a time. Common words snap together in a few clicks, and rare words never finish and stay in pieces. Click any token above, or type a word here.
Two things to notice. First, the merges don't go left to right. They follow , so the most common pair anywhere in the word fuses first, hopping around as it goes. Second, none of this is the model "reading." It's prep work that finishes in microseconds, before the model is involved at all, and the model only ever receives the finished pieces. It never sees the letters inside them.
Where those rules came from
Every merge above cited a , like "#13 of 11,744." Nobody wrote those rules. They were counted. Long before this tokenizer saw your text, it read a large pile of English, found the most common adjacent pair of pieces, glued them, and wrote the merge down. Then it repeated that 11,744 times. That counting phase is . Here are the actual first rules it learned, in the order it learned them.
Once training stops, the is frozen. It ships with the model and never changes again.
All of that was counting. Training the model itself is a different loop where it guesses, gets scored and gets nudged. You can watch that loop run in How AI Learns from Examples.
Now the whole sentence
Clicking merge by merge is for humans. Here's the same process on your full sentence from the top of the page, with every word merging at once and common pairs going first. Even this replay is thousands of times slower than the real thing.
The other direction
Everything so far turns text into tokens. A also runs it backwards, and the way it does that is stranger than it looks. works one token at a time, and it does not plan the sentence first. To choose each new token it re-reads everything that came before, start to finish. Write ten tokens and it has done ten separate readings, each one longer than the last.
What the model re-reads before writing:
Click once and watch the pile on the left grow. That pile is the thing it must read again for every single token.
Guess the count
Before the tokenizer answers, make a prediction. Most people guess too low, because spaces, capital letters and rare words all cost extra.
Experiments to run
Not every language costs the same
Here's "The doctor will see you now" measured in tokens across seven languages. English is the bargain, and every other language pays a surcharge for the same meaning.
Read this one with care. The tokenizer on this page was trained on English only, which exaggerates the gap. Real multilingual tokenizers do far better, but they don't erase the effect, because their training data is still English-heavy. The size of the gap is inflated here and the direction is right. The same thought costs more tokens in most of the world's languages, which means less room in the , slower replies, and a bigger bill for the same conversation.
How much actually fits? It's per message. Every time you press send, the app re-sends the entire conversation: the system instructions, every previous message, any attached files and your new one. The model reads that whole bundle, replies and keeps nothing. The transcript gets re-fed from scratch every time. So the window caps any one moment. It doesn't slowly drain over a chat, and a new chat starts empty.
A model's is everything it can hold at one time, measured in tokens. That covers the whole conversation, including everything before your latest message. The numbers get thrown around a lot without much sense of scale, so here is what they hold in things you can picture.
What happens when a chat outgrows the window. Something has to give, and products handle it differently: quietly dropping the oldest messages, summarizing them, or refusing the request outright. That silent dropping is why a very long conversation can start "forgetting" what you said at the beginning. The model hasn't forgotten anything. That text just isn't being sent anymore. Attachments compete for the same space, so a long PDF can swallow most of a window before you've typed a word, and the reply has to fit alongside everything else. Starting a fresh chat hands you the whole window back.
Why not just use bigger chunks?
If fewer tokens means a smaller bill, why doesn't every tokenizer use enormous chunks? Drag the slider to find out. It caps how many of the 11,744 learned rules this tokenizer is allowed to use, which is what training to a smaller would have produced.
0tokens for your text
—versus the full rulebook
0vocabulary entries
Every token costs the same to think about
A model spends the same on every token, whether it holds one letter or eight. So finer tokenization lengthens the bill and also hands the model more positions at which to think about the same sentence. Chunky tokens compress well and reason badly.
This is where arithmetic breaks
Type a number into the box at the top and drag the slider. Digits that fuse into odd chunks stop lining up with place value, and the model is left doing math on pieces that don't mean anything. Spelling fails the same way. That's the strawberry problem.
The vocabulary is a fixed budget
Every slot spent on a long English chunk is a slot not spent on code, math notation, or another language. Widen the coverage and English compression gets a little worse. The seven-language chart above is that budget being divided up.
So was never the goal
It's a proxy. The real target is quality per dollar, and the number that matters is cost per finished task. A model that uses more tokens but gets it right the first time, with no retry, is cheaper by every measure you'd care about.
This tradeoff is still live. In April 2026, Claude Opus 4.7 switched to a newer tokenizer that produces roughly 30% more tokens for identical text, which Anthropic describes as contributing to improved performance across a wide range of tasks, and later Claude models kept it. Over the same stretch, the price per token fell hard: Claude Opus cost $15 per million input tokens and $75 per million output in 2024, and $4 and $20 by September 2026. So the industry deliberately moved away from maximum compression, with more tokens each costing about a quarter as much. A lower price per token doesn't even guarantee a lower price per sentence, since vendors slice the same text into different numbers of pieces. (Anthropic hasn't published the specific design decisions behind that tokenizer. The principles above are how tokenizer tradeoffs work in general.)
Why any of this matters
Memory is measured in tokens
A model's , how much it can "hold in mind," is counted in tokens. Words don't enter into it. 128,000 tokens ≈ a 300-page book.
So is the bill
API pricing is , in and out. Wordy prompts and rare vocabulary literally cost more money.
It explains famous failures
For years, models famously answered that strawberry has two r's. They don't see letters, just a couple of chunks. Today's models mostly get that one right (it became infamous enough to learn), but the blind spot is real: counting letters inside a token is like reading a word you swallowed whole.
Not all languages cost the same
Tokenizers are trained mostly on English-heavy text, so the same sentence in Thai or Telugu can take several times more tokens, which means less context and higher cost.