Token

In plain English

AI models don't read whole words; they break text into pieces called tokens. In English, a token is roughly three-quarters of a word, so 100 words is about 130 tokens.

In practice

Tokens are the unit of AI cost and limits. API prices are quoted per million input and output tokens, and context windows are measured in tokens. Languages other than English, and code, often take more tokens for the same content.

Under the hood

A tokeniser, commonly using byte-pair encoding, splits text into sub-word units from a fixed vocabulary, each mapped to an integer ID and then to an embedding vector. Token counts differ between model families because each uses its own tokeniser.

Example

"Our monthly AI bill depends on how many tokens we send and receive."

•