A token is the piece of text a language model splits your input into before it processes it. Short, common words are usually one token, while long or rare words are broken into several parts. Models read, calculate and answer in tokens only, and through the API you pay per token too.
Picture a box of Lego bricks. Common words have a ready-made brick, and for rare words the model has to snap smaller pieces together. "Hello" is a single brick. "Kundenzufriedenheitsumfrage", the German word for a customer satisfaction survey, takes 8.
Here you learn how the splitting works, why some languages need more tokens than English, and what that means for costs and the context window.
1. How a model splits your text
The examples below were counted with the o200k_base tokenizer, which OpenAI introduced with GPT-4o. Each colored box is one token. The dot at the start of a box stands for a space that belongs to the token.
The German sentence needs 12 tokens and the English one 11, even though the English sentence has almost twice as many words. Per word, that is 2 against 1.1. The reason is compound words. What English spreads over several short words, German packs into one long word, and the tokenizer splits that word into several pieces. The gap grows with longer compounds. "Kundenzufriedenheitsumfrage" takes 8 tokens, "customer satisfaction survey" only 3.
2. How a tokenizer works
Most current models use a variant of byte pair encoding (BPE). Rico Sennrich and colleagues proposed the method for machine translation in 2015, and it works like this:
- At the start, every character is its own token (in OpenAI's tokenizers, more precisely every byte).
- The algorithm looks through huge amounts of text for the most frequent pair of neighboring tokens and merges it into a new one.
- It repeats this until the box has the desired size. For o200k_base, that is around 200,000 tokens.
Whatever appears often in the training texts becomes a token of its own. Because those texts are mostly English, English words are more often whole tokens than words in other languages. Every token has a number, and the model calculates only with those numbers. It never sees the text itself.
3. Why some languages need more tokens than English
The same content takes a different number of tokens depending on the language. A 2023 study by Aleksandar Petrov and colleagues showed that the same translated text can need up to 15 times as many tokens in some languages as in English. English is the cheapest case. German is not an extreme one, but it sits noticeably above English.
This has three practical consequences:
- Higher costs. You pay per token, not per word.
- Less room. Less German text than English text fits into the context window.
- Longer waits. The answer is produced token by token, so more tokens take longer.
Numbers behave differently than you might expect, too. In the sentence "I received an invoice for €1,249.90 today.", the amount including the euro sign takes 6 tokens, because digit groups, comma and period are tokens of their own. That is one reason language models make mistakes when they calculate with long numbers.
4. A worked example: what a job costs
Say you send a prompt of 1,000 words, for example a briefing with research material, and get a text of 1,500 words back. For longer texts we assume roughly 1.35 tokens per English word, a little more than in the sentence above, because numbers, names and rarer words add pieces. That is about 1,350 input tokens and 2,025 output tokens. Here is what that costs through the API:
- Input per 1M tokens
- $4.00
- Output per 1M tokens
- $20.00
- Prompt (1,000 words)
- $0.0054
- Answer (1,500 words)
- $0.0405
- Total
- $0.0459
- Input per 1M tokens
- $2.00
- Output per 1M tokens
- $10.00
- Prompt (1,000 words)
- $0.0027
- Answer (1,500 words)
- $0.0202
- Total
- $0.0229
- Input per 1M tokens
- $2.00
- Output per 1M tokens
- $10.00
- Prompt (1,000 words)
- $0.0027
- Answer (1,500 words)
- $0.0202
- Total
- $0.0229
- Input per 1M tokens
- $1.00
- Output per 1M tokens
- $5.00
- Prompt (1,000 words)
- $0.00135
- Answer (1,500 words)
- $0.0101
- Total
- $0.0115
- Input per 1M tokens
- $2.00
- Output per 1M tokens
- $10.00
- Prompt (1,000 words)
- $0.0027
- Answer (1,500 words)
- $0.0202
- Total
- $0.0229
- Input per 1M tokens
- $0.10
- Output per 1M tokens
- $0.50
- Prompt (1,000 words)
- $0.000135
- Answer (1,500 words)
- $0.00101
- Total
- $0.00115
Two things stand out. First, the answer is almost always the bigger cost block, because output tokens cost several times more than input tokens. Second, the priciest model in the table costs about 40 times as much as the cheapest. For reasoning models, the tokens of the internal thinking steps come on top. You pay for them as output even though you never see them. Work out your own project with the API cost calculator.
5. Common misconceptions
- A token is a piece of text. For German text there are on average more tokens than words, and in English the two come close.
- Every model family has its own tokenizer. The same text gives different numbers for Claude, GPT and Gemini.
- Each request also counts the system prompt, the chat history, files and the answer.
- You do not pay per token, but usage limits and the length a chat can hold still depend on tokens.
- It sees only token numbers. That is why models struggle to count letters in a word.
You can test the last point yourself. Ask a model without a thinking mode how many "e" letters are in "Kundenzufriedenheitsumfrage". Because it sees the word only as 8 building blocks, it gets this wrong more often than you would expect.
6. What this means for you
- Count instead of guessing. The token counter shows how many tokens your text has. For Claude, Anthropic offers its own counting endpoint in the API.
- Add a margin for other languages. The rule of thumb that one token is three quarters of a word holds for English. If you write in German or another language, plan for more.
- Watch the output. Long answers and reasoning models drive costs more than long prompts. Limit the answer length when you do not need more.
- Use caching for recurring material. If you send the same long document again and again, prompt caching saves a large part of the input cost.
- Keep the context lean. A long chat history is sent again with every new message. A new chat with a short summary saves tokens and keeps the model focused.
- Compare prices per million tokens. You find current values in the LLM price index and in the profiles in the model directory.
