Tokenizer
A tokenizer is the algorithm that splits text into the tokens a language model actually reads — BPE, SentencePiece, or tiktoken in 2026.
In more detail
What it means
Different models use different tokenizers (cl100k_base for GPT-4 and o-series, o200k_base for GPT-4o, custom tokenizers for Claude, Gemini, Llama). The same string can tokenize to wildly different counts across models, which directly affects price and context use. Non-Latin scripts (Turkish, Arabic, Hindi, Chinese) tokenize more densely than English, sometimes 1.5–2× more tokens per word — a hidden multiplier on localised products. Use a per-model tokenizer when estimating cost, never a generic word-to-token ratio. Tokenizer choice also affects context budgeting, caching, and evaluation comparability, because identical text occupies different context fractions on different models. For multilingual products, measure token cost per language with the production tokenizer before setting limits, since agglutinative languages and scripts without whitespace boundaries expand fastest. Keep a pinned tokenizer version in cost tooling so estimates stay reproducible when vendors update encodings.
Part 1 of 1
Common mistakes
- Estimating cost with 'words × 1.3' instead of the real tokenizer.
- Ignoring tokenization differences when porting prompts across models.
FAQ
Questions readers ask.
What is tokenizer?
A tokenizer is the algorithm that splits text into the tokens a language model actually reads — BPE, SentencePiece, or tiktoken in 2026.
What are the common mistakes with tokenizer?
Estimating cost with 'words × 1.3' instead of the real tokenizer. Ignoring tokenization differences when porting prompts across models.
Last updated: 2026-09-18. Raw markdown: https://promtable.com/glossary/tokenizer.md. Found a mistake? Tell us.