GlossaryEntry 27 of 30

Token

The smallest unit of text an AI reads: a word, part of a word or a symbol.

Read the transcript

An AI… never sees your letters. AI glossary, entry twenty-seven: the token. It's the smallest unit of text an AI reads: a word, part of a word, or a symbol. First, the AI chops up your text. “The cat sleeps on the couch.”: seven tokens, period included. A common word fits in one token. A rare word gets cut into pieces: “antidisestablishmentarianism”… six tokens. Then every token becomes a number. Here, “cat” becomes nine thousand fifty-nine. The AI only reads a string of numbers… that's why it sometimes slips when you ask it to count letters. And everything is counted in tokens. The price: paid AIs bill per token. And the memory: an AI can only read so many tokens at once. Remember: your text is cut into tokens, each token becomes a number, and everything is counted in tokens. The token is the currency of AI. Next entry: Training.

How it works

An AI doesn't read words the way you do. Before it understands anything, it splits your text into small pieces called tokens, then swaps each one for a number. Common words usually fit in a single token; rare words get cut into several pieces.

Real split by the GPT-4o tokenizer7 tokens

The cat sleeps on the couch.

  1. The976
  2. cat9059
  3. sleeps104072
  4. on402
  5. the290
  6. couch39492
  7. .13
  • Hello1 tokenCommon word: one piece.
  • strawberry3 tokensLess common: three pieces.
  • antidisestablishmentarianism6 tokensVery rare: six pieces.

Why it matters to you

The price

Paid AI services bill per token, for what they read and for what they write. A long text costs more than a short one.

The memory

An AI can only read a limited number of tokens at once: its context window. Beyond that, the start of the text is no longer taken into account.

Common myth

False: “A token is a word.”

Not always. A rare word can take six tokens, and a period counts as one on its own.

In the news