Skip to content

Tokens

AI glossary

Tokens

Also called: token

Tokens are the pieces of text a language model actually reads and writes. In 2026 almost every API bill, context limit, and “this prompt is too long” error is counted in tokens, not in words or pages. A token might be a short word, part of a word, a space, or a punctuation mark.

Diagram showing a sentence split into example tokens
An illustration of how a sentence can be split into tokens. Real tokenizers differ by vendor.

Why models do not read raw characters

A tokenizer maps text into a fixed vocabulary of tokens the model was trained on, then maps tokens back into text when the model talks. That split is learned so common words stay whole and rarer strings break into smaller pieces. The same sentence can have a different token count in OpenAI, Anthropic, Google, or an open-weight model, because the vocabularies differ.

This is also why some languages and some kinds of code “cost” more than a word count would suggest. A short identifier, a piece of Unicode, or a snippet of JSON can become many tokens.

What tokens change in a product

Your context window is a token budget. Retrieved documents, system instructions, and chat history all compete for it. A 128,000-token window is large, but it is not infinite, and filling it blindly can hurt quality as well as price.

Streaming, latency, and tokens per second are also token stories: users wait on output tokens, and a model that rambles is both slower and more expensive.

A practical habit

Count tokens on real examples with the same tokenizer your API uses, not with a guess of “four characters per token.” Keep a reserve for the answer. And do not treat a token count as a quality metric; a tighter prompt can be better even when it is slightly longer, if it includes the one rule that matters.

A concrete example

Example A 750-word blog paragraph might be roughly a thousand tokens, but the exact count depends on the tokenizer.

FAQs about Tokens

About how many tokens are in an English word?

A rough rule of thumb is a little more than one token per word in plain English, but it is only a rough rule. Code, tables, and other languages can look very different. Measure with the real tokenizer.

Why did my short prompt use so many tokens?

You may have included hidden history, a long system prompt, or a big retrieved file. Base64 images and some markup are also costly. Log the actual prompt the API sees.

Do output tokens cost the same as input tokens?

Often not. Many vendors charge more for generated tokens than for input tokens. Check the current price table for the model you use.

Is a token the same as a word in every language?

No. Tokenizers trained mostly on some languages can split others more aggressively, which raises both cost and the chance of awkward completions.

Back to the full AI glossary