Foundations

Token

Also called: tokens

A token is the unit of text a model reads and writes: a chunk that is usually part of a word, not a whole word or a single character. Everything is measured in tokens, including your context window and your bill.

James Phoenix
Understanding Data Updated July 2, 2026

Models do not see letters or words. Before anything happens, your text is split into tokens: short chunks drawn from a fixed vocabulary. A common word like the is one token; a longer or rarer word like tokenization might be split into several. As a rough rule for English, one token is about four characters, and 100 tokens is roughly 75 words. Code, punctuation, and non-English text tokenize differently, often less efficiently.

Why you should care about a low-level detail

Tokens are not just an implementation detail. They are the unit almost everything is measured in:

  • The [context window](/ai-coding-dictionary/context-window) is counted in tokens. A "200K context" means 200,000 tokens, not words or lines.
  • Pricing is per token. You pay for tokens in and tokens out, so a verbose prompt or a giant pasted file has a direct cost.
  • Limits bite in tokens. When an agent says it is running low on room, it is running low on tokens.

A practical consequence

Because tokenization is uneven, "small" inputs can be surprisingly expensive. A minified bundle, a wall of JSON, or a base64 blob can burn far more tokens than its character count suggests, while crowding out the code you actually want the model to focus on. Being deliberate about what you hand a model, and in what form, is really an exercise in spending tokens well.

Tip
If you want intuition for how your own text tokenizes, most model providers publish a tokenizer you can paste text into. Seeing a paragraph split into tokens once makes the context window feel a lot more concrete.

Related terms

Building with AI agents?

This dictionary is part of how I think about agentic engineering. If you want the same thinking applied to your codebase, that is what I do.

See how I can help