Skip to content

Token

The unit a model reads and writes. Roughly word-sized, but not exactly.

Text reaches a model as tokens, produced by a tokenizer: a fixed vocabulary of tens of thousands of fragments learned before training. Common words are often one token; rare or long ones split into several. The model never sees characters or words, only token IDs.

Everything is priced and measured in tokens. A token is roughly three-quarters of an English word, so a thousand tokens is about 750 words. Code is less predictable: a hash such as `a3f9c2e1` never appeared in the tokenizer's training material, so it splits into many tokens, while `function` is one. That is why a small file full of unusual strings can eat a surprising share of the context window.

Related terms

Want this working inside your team?

It starts with one conversation about your workflow.

Ask on WhatsApp