PromptForge
AI Glossary

Core concepts

Tokenizer

Also known as: bpe, byte-pair encoding

Definition

A tokenizer is the component that splits text into tokens before a model processes it. Different model families use different tokenizers, which is why the same text can have different token counts on GPT versus Claude.

Tokenizers are trained on large text corpora to find the most efficient set of subword fragments. The dominant approach is byte-pair encoding (BPE), which starts from individual characters and repeatedly merges the most frequent adjacent pair until it reaches a target vocabulary size — typically 50,000 to 200,000 tokens.

Because each model family trains its own tokenizer, counts differ between providers. This matters when you are comparing costs: the same prompt may be 1,000 tokens on one model and 1,150 on another, which changes the real price per request even if the headline rate looks identical.

Tokenizer efficiency also varies dramatically by language. English is heavily represented in training data and tokenizes efficiently. Languages with non-Latin scripts, and code with unusual whitespace, can consume several times more tokens for the same information.

Related terms

Put this into practice

Understanding the term is step one. Our free courses and tools let you actually use it.