The model does not read text as a whole: before processing, the tokenizer splits it into tokens — the indivisible chunks that both the prompt and the answer are made of. The number of tokens determines what fits into the context window, how much a request costs and how fast the answer is generated.
How text becomes tokens
The tokenizer splits text into subwords — chunks smaller or larger than a word: frequent character combinations are stored in the model’s vocabulary as a single token, while rare ones are broken into pieces. Each model has its own vocabulary, and training and inference happen only within it; most often the vocabulary is built with the BPE algorithm (byte pair encoding).
| Text | How it is usually split into tokens | Why |
|---|---|---|
| a frequent short word | 1 token | it is in the vocabulary as a whole |
| a rare or long word | 2–4 tokens | the vocabulary holds not every word but frequent chunks |
| numbers, URLs, code | many tokens | such sequences are broken into small pieces |
| spaces and punctuation | separate tokens or part of a word | the space is attached to the next word |
How to count tokens
For English text, one token is on average about four characters or 0.75 of a word, so 100 tokens is roughly 75 words. The ratio differs for other languages: text in a language other than English usually produces more tokens in models trained mostly on English than the same text in English. Estimates by words and characters are rule-of-thumb, and the exact count is given by the tokenizer of the specific model — for OpenAI models it is the tiktoken library, other models have their own tools.
Where tokens appear in practice
- context window: the model’s limit is set in tokens — how much prompt and answer it takes in at a time
- API pricing: the rate is quoted per million tokens, separately for input and output
- provider limits: alongside requests per minute, tokens per minute are limited too
- inference metrics: time to first token (TTFT) and throughput in tokens per second
A token is not a word
A token is neither a word nor a character: it may be a whole word, part of a word, a punctuation mark or a space. So a “1000 tokens” label does not mean “1000 words”, and the cost of a request cannot be converted by dividing the price by the number of words. Inside the model, a token is a number in the vocabulary that is turned into a vector (an embedding); it is these vectors that the model processes.
Sources
the term is written from these pages- OpenAI Help Center — Understanding and counting tokenshelp.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them(opens in a new tab)
- Hugging Face Transformers — Tokenizers (subword-токенизация, BPE, SentencePiece)huggingface.co/docs/transformers/en/main_classes/tokenizer(opens in a new tab)
Verified 9 Nov