Tokenizer
Type a text and see the pieces the model actually reads.
What this lab shows
Language models do not read letters or words: they read tokens, pieces of text turned into numbers. This lab uses the real o200k_base tokenizer, from OpenAI's GPT-4o models, running in your browser.
The free text field downloads the tokenizer, about 1 MB, the first time you type.
How to use it
- Pick one of the examples or type your own text.
- See each token in a color and the count of characters, words and tokens.
- Turn on "Show numbers (IDs)" to see what the model actually receives.
The o200k_base tokenizer, used in OpenAI's GPT-4o models. Each company has its own, and the counts change from one to another. The ␣ symbol marks a space that is part of the token.
Artificial intelligence
Artificial␣intelligence
23 characters · 2 words · 2 tokens
AI doesn't read words: it reads pieces called tokens.
AI␣doesn't␣read␣words:␣it␣reads␣pieces␣called␣tokens.
53 characters · 9 words · 11 tokens
unconstitutionally
unconstitutionally
18 characters · 1 words · 3 tokens
Inteligência artificial
Inteligência␣artificial
23 characters · 2 words · 4 tokens
Olá, tudo bem?
Olá,␣tudo␣bem?
14 characters · 3 words · 5 tokens
The lab could not load. The summary above still applies.
Books that use this lab
NewWhat Are Tokens, and Why AI Doesn't Read Words