Skip to content

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

  1. Pick one of the examples or type your own text.
  2. See each token in a color and the count of characters, words and tokens.
  3. Turn on "Show numbers (IDs)" to see what the model actually receives.
LabTokenizerTry it

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

What to notice: Common words become a single token; rare names and long words get split. Portuguese and Spanish usually take more tokens than English.
Understand the conceptWhat Are Tokens, and Why AI Doesn't Read Words

Books that use this lab