What is a token in AI and why you pay for them

A token is the smallest unit of text a language model works with: a whole short word, part of a longer word, a punctuation mark or a space. Models read and write in tokens.

Text is cut into tokens

In plain words

Remember sounding out words syllable by syllable in first grade? A language model also "reads in pieces", but its pieces are tokens, not syllables. Common words are one token, rare ones are several. That way the model can spell any word, even a made-up one, from a limited "alphabet" of pieces.

How it works

  1. Before processing, text is cut into tokens by a special program called a tokenizer.
  2. Each token gets its own number, because neural networks work with numbers.
  3. The model also generates its answer one token at a time.
  4. In English a word is on average a bit more than one token; many other languages need more tokens per word.
  5. The number of tokens decides how much text fits in the model's memory and how much a request costs.

The model writes its answer token by token

Where you'll see it

You'll hear about tokens when reading about chatbot limits, API prices for developers or a model's context window: "128 thousand tokens", "1 million tokens". On-device AI speed is also often measured in tokens per second.

Does it matter when buying

For a regular user - not really; just know that long documents may "not fit". But if you code and use AI through an API, tokens are money: you pay separately for input and output. Also, a local model on a laptop or phone that produces 20+ tokens per second already feels fast.

Myths

  • Myth: One token is one word. Reality: Not always. A long or rare word can take several tokens.
  • Myth: The same text costs the same in any language. Reality: Often not: many languages need more tokens than English for the same text.

FAQ

How many tokens are in a page of text?

Roughly a few hundred, depending on the language and model.

How do I count tokens?

Some services have online token counters, and APIs return the exact count.

Are AI tokens the same as crypto tokens?

No, they're completely different things with the same name.

Related terms

Context window, Large Language Model, Prompt, Model parameters

← Glossary