
You paste the same paragraph into two AI systems and get two different token counts. The words have not changed. Has one system counted incorrectly?
Not necessarily. A token is not a standard unit like a character or a byte. Its boundaries depend on the tokenizer used by that model. Two models can represent identical text with different sequences of tokens.
That small detail matters when you estimate API costs, compare models or build a product that processes thousands of messages.
A token is a piece of encoded text
Before a language model processes text, a tokenizer converts it into a sequence of numerical identifiers. Those identifiers correspond to pieces in its vocabulary. A piece can be a whole word, part of a word, punctuation or a sequence that includes whitespace.
It is tempting to imagine the tokenizer simply cutting at every space. Modern subword approaches are more flexible: they can represent familiar sequences with larger pieces and other sequences with smaller ones. Hugging Face describes several approaches, including byte-pair encoding, WordPiece and Unigram, in its tokenization guide.
The important word is vocabulary. Here, it means the inventory of pieces the tokenizer can represent, not merely a dictionary of ordinary words.
Different inventories produce different boundaries
Consider the word notebook. In a deliberately simplified example, one tokenizer could represent it as note | book, while another could use not | e | book. Both sequences reconstruct the same spelling.
These are illustrative splits, not measured results from named models. The point is that counting the pieces depends on how the system chooses the boundaries, not just on how many letters you typed.
Byte-pair encoding, or BPE, is one common way to build such a representation. Broadly, it learns reusable combinations from smaller units. OpenAI’s tiktoken documentation explains its reversible BPE representation and provides model-aware encoding selection. Different vocabularies and merge rules can therefore produce different token sequences even within the same broad algorithm family.
Different model names do not always mean different tokenizers, either. Some models share an encoding. The useful question is “Which tokenizer does this model use?”, not “Which company’s logo is on the page?”

Why your own text matters
A neat English sentence is not a reliable stand-in for every workload. A customer-support system may receive names, local languages, spelling variations and emoji. A coding assistant may receive paths, identifiers, indentation and long error logs.
These inputs contain different patterns. How compactly they are represented depends on the tokenizer’s rules and vocabulary. A word-to-token shortcut can be useful for a rough estimate, but it is not a universal conversion formula.
For a Nigerian product, a practical test set might include English support messages, Yoruba text with diacritics, Hausa or Igbo messages where relevant, and the actual mixture customers use. This is a testing recommendation, not a claim that a particular language will always produce more tokens.
Do not remove meaningful accents, punctuation or spacing just to chase a smaller number. A cheaper prompt that changes a person’s name, damages code or loses an instruction is not a successful optimisation.
Counting a paragraph is not counting the whole request
Your visible message may be only part of what the API receives. System instructions, conversation history and tool definitions can also contribute to the request. That makes a pasted-text counter different from a counter that understands the full message structure.
Anthropic’s token-counting documentation provides a model-specific counting endpoint and recommends comparing the same request under the models being evaluated. It also distinguishes an estimate from the eventual request’s usage.
For a fair experiment, hold the request constant. Changing the model and trimming the history at the same time makes it difficult to tell what caused the difference.
Fewer tokens does not automatically mean a lower bill
Token count and token price are separate variables. Input and output can have different rates, and features such as caching may have their own pricing. The Claude pricing documentation, for example, separates these categories.
For a simple text-only request without special pricing, the starting calculation is input tokens multiplied by the input rate, plus output tokens multiplied by the output rate. Apply the provider’s actual pricing units and any other applicable charges.
A model that uses fewer input tokens can still cost more if its rate is higher or its answer is much longer. And a cheap first attempt may become expensive if your application needs repeated attempts to get a usable answer.
A practical comparison checklist
- Choose representative examples. Include real input types, but use synthetic or properly authorised data when testing external services.
- Use the correct counter. Match the tokenizer or counting endpoint to the selected model.
- Count the full request. Keep instructions, history and tool definitions consistent.
- Check completed usage and quality. Compare actual reported usage, output length and whether the task succeeded.
- Compare cost per useful result. Include retries rather than ranking models by token count alone.
The takeaway is simple: the text stays the same, but the measuring pieces can change. Measure the workload you actually have, with the tokenizer and pricing of the model you actually intend to use.