TechCompare LogoTechCompare

What are tokens in LLMs? How language models break text into pieces

Tokens are how LLMs see text. Understanding them helps you estimate costs, stay inside context windows, and write better prompts. The 4-chars-per-token rule of thumb is good enough for back-of-the-envelope estimates. For exact counts, use a tokenizer.

A token is the atomic unit of text that a language model processes. It's not quite a word and not quite a character. Common words like 'the' are usually one token each. Longer or less common words like 'tokenization' might be split into two or three tokens. As a rule of thumb, one token is roughly 4 characters of English text, or 100 tokens is roughly 75 words.

By TechCompare · Updated

Knowledge area
Fundamentals
How tokens and tokenization work
Topic focus
What are tokens
what-are-tokens

How this is calculated

Tokens exist because language models don't understand text directly. They understand sequences of numbers. A tokenizer converts text into tokens, and each token maps to a numeric ID in the model's vocabulary. The model processes these IDs, not the raw text. Different model families use different tokenizers with different vocabularies, which is why the same sentence can produce a different token count for GPT-5 vs Claude vs Llama 4. OpenAI's o200k_base tokenizer (used by GPT-5 and GPT-4o) has a vocabulary of 200,000 tokens and is more efficient than older tokenizers like cl100k_base, typically producing fewer tokens for the same input.

Verdict

A token is the unit a language model actually reads, and each one maps to a numeric ID in the model's fixed vocabulary. Common words compress to a single token, while rare or longer ones split into subwords, which is why 'the' and 'tokenization' cost different amounts. The o200k_base tokenizer in GPT-5 and GPT-4o builds a 200,000-entry vocabulary, so identical text produces a different count than it does on Claude or Llama 4.

More Tokens scenarios

OpenAI vs Llama tokenizer
A sentence that costs 50 tokens on GPT-5 might cost 55 tokens on Llama 4 or 48 on Claude.
View details ➜
Token limits by model
Context window size is the maximum number of tokens a model can process in a single request, including both input and output.
View details ➜
Prompt optimization
Prompt optimization is the practice of getting the same or better results from an LLM with fewer input tokens.
View details ➜

Frequently asked questions

What is a token in an LLM?
A token is the atomic chunk of text a language model actually processes. It sits between a character and a word: common words like 'the' are one token, while longer or rarer words split into two or three subword tokens. As a planning rule of thumb, 100 tokens is roughly 75 English words, or about 4 characters per token.
Why do language models use tokens instead of words?
Numbers, not text, are what a model consumes, and a fixed token vocabulary is the bridge. A word list can't cover misspellings, code, or invented terms, while subword tokens can rebuild any input from known pieces. That's why 'tokenization' splits into familiar chunks instead of erroring on an unknown word.
How many words is 1,000 tokens?
About 750 English words with ordinary prose. Dense code, unusual punctuation, or non-English text skews the ratio, sometimes badly - a Japanese or Hindi passage can run 2-3 times the tokens of its English translation. For billing-level accuracy on your actual content, run a real tokenizer rather than the 4-chars-per-token estimate.