What Is Tokenization in AI?

Tokenization is the process of breaking text into tokens, the small units a language model reads, such as whole words or pieces of words. It is the first step in turning raw text into something a model can process, and it also runs in reverse to turn the model's token output back into readable text.

How tokenization works

A tokenizer scans text and splits it into tokens according to a fixed vocabulary the model was trained with. Common words usually become a single token, while rarer or longer words are broken into smaller sub-word pieces, which lets the model handle words it has never seen by combining familiar parts. Each token maps to a number, and it is those numbers the model actually works with.

Different models use different tokenizers, so the same sentence can split into different token counts depending on the model. Details like spaces, punctuation, and non-English characters affect how text breaks up, which is why token counts do not line up neatly with word counts.

Why tokenization matters for AI

Tokenization matters because it sets the units everything else is measured and priced in. How text is split affects the token count, which in turn affects how much fits in a model's context window and what a request costs. It also shapes how well a model handles different languages and unusual words, since a language that tokenizes into more pieces uses more of the budget for the same content. Note that in payments and security, "tokenization" means something different, replacing sensitive data like card numbers with substitute values, which is unrelated to this text-processing sense.

Frequently asked questions.

The stuff we hear most on the first call. Don't see yours? Book a 30-minute conversation.

What is the difference between a token and tokenization?
A token is the unit, a word or word piece. Tokenization is the process of splitting text into those tokens. One is the result, the other is the step that produces it.
Why do different models count tokens differently?
Because each model uses its own tokenizer with its own vocabulary and splitting rules. The same text can break into different numbers of tokens from one model to another, especially across languages and unusual words.

Want to put AI
to work?

We work with leadership teams to find the right opportunities, define the strategy, and build the systems that move the business forward.