Skip to main content

What Are Tokens in AI? Explained With Examples

Tokens are the pieces of text an AI splits your input into. How it works, why German needs more tokens than English, and what 1,000 tokens cost.

FHFinn Hillebrandt
Last updated:
Basics
What Are Tokens in AI? Explained With Examples

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.

German sentence6 words, 12 tokens
DieDatenschutzgrundverordnunggiltauchfürKundenanfragen.
The same sentence in English10 words, 11 tokens
TheGeneralDataProtectionRegulationalsoappliestocustomerrequests.
A long German word1 word, 8 tokens
Kundenzufriedenheitsumfrage
The same in English3 words, 3 tokens
customersatisfactionsurvey
Counted with OpenAI's o200k_base tokenizer (tiktoken). Other models use other tokenizers and arrive at slightly different numbers.

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:

  1. At the start, every character is its own token (in OpenAI's tokenizers, more precisely every byte).
  2. The algorithm looks through huge amounts of text for the most frequent pair of neighboring tokens and merges it into a new one.
  3. 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
Claude Sonnet 5.5
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
GPT-6.1 Sol
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
GPT-6.1 Terra
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
Gemini 4 Argon
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
Claude Haiku 5.5
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
Own calculation from pricing data
gradually.ai

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 word.
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.
All models count the same.
Every model family has its own tokenizer. The same text gives different numbers for Claude, GPT and Gemini.
Only my question counts.
Each request also counts the system prompt, the chat history, files and the answer.
Tokens do not matter in a chat subscription.
You do not pay per token, but usage limits and the length a chat can hold still depend on tokens.
The model sees letters.
It sees only token numbers. That is why models struggle to count letters in a word.
Own assessment
gradually.ai

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.

Frequently Asked Questions

A token is the piece of text a language model splits your input into before it processes it. "Hello" is a single token. "Kundenzufriedenheitsumfrage", a long German compound, is split into 8 tokens, while its English equivalent "customer satisfaction survey" takes 3. The model reads, calculates and answers in tokens only, and API billing runs per token too.

For English text, 1,000 tokens are roughly 740 words. German text gets you only about 590 words from the same 1,000 tokens. The exact value depends on the tokenizer and the text: numbers, technical terms and code need more tokens. For your own text, the token counter shows the result.

It is the same thing as in any language model. A token is a piece of text, often a whole short word or part of a longer one. In the ChatGPT app you pay a flat subscription or nothing, not per token. OpenAI bills per token only through its API. There, GPT-6.1 Sol costs $2.00 per million input tokens and $10.00 per million output tokens. Smaller models are considerably cheaper, and all prices are in the LLM price index.

Through an API, yes. A single token costs a fraction of a cent, so providers quote prices per million tokens, separately for input and output. Output usually costs several times more. In the worked example on this page, the same job costs between $0.00115 and $0.0459, depending on the model. In chat apps you pay a subscription instead, but your usage limits still depend on tokens. Current prices for all models are in the LLM price index.

In a chat app, the provider carries the cost of the tokens, within the limits of your plan. When you call a model through the API, whoever sends the request pays, meaning the developer or the company behind the product, who often passes the cost on to customers through a subscription or usage fees. In the worked example above, one job costs between $0.00115 and $0.0459, depending on the model. You can work out your own project with the API cost calculator.

That is a different thing with the same name. Crypto tokens are digital assets recorded on a blockchain, and they have nothing to do with the text tokens of language models. This page covers only the text pieces a model reads and writes, and it contains no investment content.
Sources and References
FH

Finn Hillebrandt

AI Expert & Blogger

Finn Hillebrandt is the founder of Gradually AI, an SEO and AI expert. He helps online entrepreneurs simplify and automate their processes and marketing with AI. Finn shares his knowledge here on the blog in 50+ articles as well as through the AI Business Club.

Learn more about Finn and the team, follow Finn on LinkedIn, join his Facebook group for ChatGPT, OpenAI & AI Tools or do like 17,500+ others and subscribe to his AI Newsletter with tips, news and offers about AI tools and online business. Also visit his other blog, Blogmojo, which is about WordPress, blogging and SEO.