Skip to content

What is a token?

The unit models read, count and bill in — and it is not a word.

By Fiqhro Dedhen3 min readEdited by Fiqhro Dedhen

A token is the unit of text a language model actually reads. It is not a word and not a character — it sits somewhere in between. Common words are usually a single token. Rarer words get split into pieces. Punctuation and spaces count too.

Tokens matter for two very practical reasons: context windows are measured in them, and API bills are calculated from them.

Why models don't just use words

A vocabulary of whole words has an awkward problem: it can never be complete. New words, names, typos and technical jargon would all be unrepresentable.

The standard fix is subword tokenization — an approach introduced for machine translation and now used almost everywhere. Frequent words get their own token; anything unfamiliar is assembled from smaller fragments. The model can therefore represent any string at all, while keeping common text compact.

The part that costs you money

Tokenizers are trained mostly on English text, so English is the most efficient thing to feed them. The same meaning, expressed in a different language or in code, can cost noticeably more tokens.

InputWhy the token count moves
Ordinary English proseMost efficient. Common words are one token each.
Technical jargon and rare namesSplit into fragments — several tokens per word.
CodeWhitespace, indentation and symbols all consume tokens.
Languages not written in Latin scriptOften several tokens per character.
Long numbersFrequently split digit-by-digit.

The last row surprises people the most: a table of figures can be far more expensive than a paragraph of the same visual size.

Rules of thumb

  • English prose runs roughly three-quarters of a word per token — a loose convention, not a constant. It moves with the tokenizer: Anthropic's newer models emit about 30% more tokens for the same text, dragging that ratio closer to half a word per token.
  • You pay for input and output tokens, usually at different rates. Output is typically the more expensive of the two.
  • On the API, the whole conversation is re-sent every turn, so input tokens accumulate much faster than people expect.

What to actually do

If you're building something, don't estimate — count. Every major vendor ships a tokenizer library that gives exact numbers for their models, and the exact number is the one you'll be billed for. If you're just using a chat product, the practical version is simpler: pasting a large document into a conversation costs you that document on every subsequent message, not just the first.

What we addedA worked breakdown of why the same sentence costs different amounts in English, code and other languages, and what that means for your bill.

This article was researched and drafted with AI assistance from the sources listed below, then checked and edited by Fiqhro Dedhen before publication. How we work.

Sources

3 cited · 3 primary

  1. 1
    PrimaryarXiv (Sennrich et al.)
    Neural Machine Translation of Rare Words with Subword Units

    Introduced the subword (BPE) tokenization that modern LLM tokenizers are built on.

    arxiv.org · accessed 17 Jul 2026

  2. 2
    PrimaryHugging Face
    Tokenization algorithms

    Reference documentation comparing BPE, WordPiece and SentencePiece.

    huggingface.co · accessed 17 Jul 2026

  3. 3
    PrimaryAnthropic (Claude Platform Docs)
    Context windows

    Shows how token counts map onto usable context in a shipping product.

    docs.claude.com · accessed 17 Jul 2026

Primary sources are the company, paper or repository itself. Reporting is established press, used to corroborate. Community is used to find stories, never to establish facts.