Skip to content
MAMasterAI Now
KI-Tools

AI Token Counter

Paste any text to see exactly how a language model will split it into tokens — the units that decide what you pay and how much of the context window is left. The counter runs entirely in your browser.

Läuft vollständig in deinem Browser — nichts, was du eingibst, verlässt die Seite.

⚠ Dieses Tool ist noch nicht vollständig auf Deutsch übersetzt, daher wird die englische Fassung gezeigt. Die Übersetzung ist in Arbeit.

Tokenizer: o200k_baseExakt
Tokens
—
Zeichen
0
Wörter
0
Zeichen pro Token
—
Eingabekosten für diesen Text
Selbst hosten
So sieht das Modell den Text

Text eingeben oder einfügen, um die Tokens zu sehen.

What a token actually is

A language model never sees letters or words. It sees tokens: short chunks of text that were learned from data and then indexed in a fixed vocabulary. Some tokens are whole words (token), some are fragments (ing, ization), some are a single space plus a letter, and rare words are spelled out one piece at a time. Roughly, a token is to a model what a syllable is to a reader: the smallest thing it can pronounce, not the smallest thing that carries meaning.

Analogy
A token is a syllable, not a word

Ask a person to read “unbelievable” and they hear three pieces: un-be-lievable. A tokenizer does the same thing statistically — the pieces it picks are the ones it saw most often during training. That is why the is usually a single token while unbelievable may be three, and why unusual names get chopped into single letters.

  • Tokens are not characters and not words. English averages around 4 to 5 characters per token, and that ratio changes with every language and every kind of text.
  • Whitespace belongs to tokens. A leading space is usually part of the token that follows it, which is why " Hello" and "Hello" are different units.
  • Punctuation is tokenised as well. The string Hello, world! is 4 tokens with the GPT-4o vocabulary — not one, and not thirteen.
  • The vocabulary is fixed before you type anything. Your prompt is mapped onto it, never the other way around.

How this counter works — and when it is approximate

This tool runs a real byte-pair encoding (BPE) tokenizer in your browser with the gpt-tokenizer library. For OpenAI models the count is exact, because the library ships the same rank files the API uses: o200k_base for GPT-4o, o1 and o3-mini, and cl100k_base for GPT-4 Turbo and GPT-3.5 Turbo. For providers that do not publish their tokenizer — Anthropic, Google, Mistral, DeepSeek, Meta — the widget counts with the closest OpenAI encoder and labels the result approximate. On ordinary prose those estimates land within roughly a tenth of the true count, but treat them as a planning aid, never as an invoice.

Model familyTokenizer used hereAccuracy
GPT-4o, o1, o3-minio200k_baseExact
GPT-4 Turbo, GPT-3.5 Turbocl100k_baseExact
Claude (Anthropic)o200k_baseApproximate
Gemini (Google)o200k_baseApproximate
Mistral, DeepSeek, Llama, Qweno200k_baseApproximate
tokens ≈ characters ÷ 4 (English prose only)
A rule of thumb, useful as a sanity check. Measured on a 50-word English paragraph, both vocabularies produced 56 tokens for 281 characters — about 5 characters per token, so ÷4 overshoots slightly on ordinary prose and badly on code or on languages the vocabulary was not trained on.
NoteYour text never leaves the page

The tokenizer runs locally in your browser. Nothing you paste is sent to a server, stored, logged or used for training. You can confirm it in the network panel of your developer tools: no request is made while you type.

Why the same sentence costs more in Hindi, Turkish or Arabic

Tokenizers are trained on a text mix still dominated by English, so the vocabulary is packed with English fragments and much thinner for other writing systems. A sentence that means exactly the same thing can therefore cost two to three times as many tokens in another language — and with it two to three times as much money. The table below is the same sentence in eight languages, counted with both OpenAI vocabularies, so the difference is visible rather than asserted.

LanguageSentenceo200k_basecl100k_base
EnglishThe quick brown fox jumps over the lazy dog.1010
GermanDer schnelle braune Fuchs springt über den faulen Hund.1415
FrenchLe renard brun rapide saute par-dessus le chien paresseux.1418
SpanishEl rápido zorro marrón salta sobre el perro perezoso.1517
TurkishHızlı kahverengi tilki tembel köpeğin üzerinden atlar.1721
Arabicالثعلب البني السريع يقفز فوق الكلب الكسول.1630
Hindiतेज़ भूरी लोमड़ी आलसी कुत्ते के ऊपर कूदती है।2049
Chinese敏捷的棕色狐狸跳过了懒狗。1425

Two lessons fall out of that table. First, the newer o200k_base vocabulary is markedly better outside English — the same Hindi sentence drops from 49 tokens to 20 — which is a concrete reason to move a multilingual product onto a GPT-4o-class model. Second, scripts without spaces behave differently again: the Chinese sentence is a single whitespace-delimited “word”, yet it is 14 tokens, because each character or character pair is its own unit.

Watch outBudget per language, not per feature

If you ship in eight languages, estimate cost for each of them instead of applying the English number everywhere. A Turkish or Hindi prompt is routinely 1.5× to 3× the English token count, and that difference shows up on the invoice rather than in the demo.

How to read the numbers above

Four figures sit next to the text you paste. Tokens is the one that controls billing and the context window. Characters is what most APIs and database columns limit. Words is what a human counts. Characters per token is the health check: for English prose, values between roughly 4 and 5.5 are normal, while a value near 2 tells you the text is code, non-Latin script or unusually punctuation-heavy — and that the prompt is more expensive than its length suggests.

A worked example: a 50-word English paragraph of 281 characters counts as 56 tokens, which is 5.0 characters per token and 1.12 tokens per word. Scale that to a 300-word support reply and you are near 340 input tokens. Add a 400-token answer and one request against a model priced at $0.15 per million input tokens costs well under a hundredth of a cent. Multiply by traffic and the number that looked negligible becomes a line item — which is exactly what the companion cost calculator does.

  1. 1Paste the text you would really send, including system instructions and any retrieved context.
  2. 2Compare the token count with the model’s context window, leaving room for the completion.
  3. 3Check the tokens-per-word ratio in each of your languages to see where the budget actually goes.
  4. 4Feed the token count into the cost calculator to turn it into money per month.

Five mistakes this counter prevents

  • Assuming four characters per token everywhere. That shortcut is English-specific. On Hindi it can be wrong by more than a factor of two.
  • Counting words instead of tokens. A 1,000-word English document is usually around 1,100–1,300 tokens, and every embedded code sample or table pushes it higher.
  • Forgetting the completion. The context window holds prompt and answer. A 100,000-token prompt on a 128,000-token model leaves very little room to reply.
  • Ignoring message overhead. Chat APIs add a few special tokens per message for role and turn boundaries, so a conversation of thirty short messages costs more than the thirty messages counted separately.
  • Trimming the wrong end of a prompt. Halving a long document saves tokens but often destroys the answer. Shrinking repeated few-shot examples usually saves the same tokens and changes nothing.

Where the token count goes next

Tokenisation is the first step of the lifecycle, not an accounting detail. The count you see here decides four things downstream: whether the prompt fits the context window at all, what the request costs, how much GPU memory the KV cache needs while the model generates, and how faithfully a long retrieval pipeline behaves. Stage 5 of the course builds a byte-pair encoder from scratch so you can watch merges happen, Stage 11 shows the arithmetic that turns a context length into VRAM, and the companion cost calculator converts the number on this page into a monthly bill.

Häufige Fragen

How many tokens is 1,000 words?
For ordinary English prose, roughly 1,100 to 1,300 tokens. Measured on a 50-word sample paragraph, the GPT-4o tokenizer produced 56 tokens for 50 words — 1.12 tokens per word. Code, tables, URLs and non-Latin scripts all push the count higher, so treat any words-to-tokens rule as a rough estimate and check the real text.
Is the token count exact?
For OpenAI models, yes — the tool runs the same o200k_base or cl100k_base vocabulary the API uses. For Claude, Gemini, Mistral, DeepSeek, Llama and Qwen the count is clearly labelled approximate, because those providers do not publish their tokenizer; the closest OpenAI encoder is used instead. That is usually accurate enough for planning, but confirm large figures with the provider’s own token-counting endpoint.
Do spaces and punctuation count as tokens?
Yes. A leading space is usually attached to the token after it, and punctuation forms its own token or joins a nearby one. “Hello, world!” is 4 tokens with the GPT-4o vocabulary: the word, the comma, the space-plus-word, and the exclamation mark.
Is my text uploaded to a server?
No. The tokenizer runs inside your browser and nothing is transmitted, stored or logged. There is no server-side component — the tool is a static page plus a JavaScript file containing the vocabulary. You can confirm it by watching the network panel while you type: no request is made.
Why is non-English text counted differently?
Because the vocabulary was learned mostly from English text, so English fragments are well represented and other scripts are not. A sentence taking 10 tokens in English takes about 14 in German or French, 15–17 in Spanish, Arabic or Turkish, and 20 in Hindi with the newest OpenAI vocabulary. Those differences translate directly into cost.
How do I reduce my token count?
Shorten repeated instructions, drop few-shot examples that no longer change the output, send only the retrieved passages the answer needs, and prefer a summary over an entire transcript. Prompting in the language you actually need avoids translating long text into English and back. Switching vocabulary is the other lever: the same Hindi sentence costs 20 tokens with o200k_base and 49 with the older cl100k_base.

Das passende Kapitel im Kurs

Dieses Tool ist die praktische Ergänzung zu diesen Stufen des kostenlosen 11-Stufen-Kurses.

  • LLM API Cost Calculator →

    Turn a token count and a traffic guess into a real monthly bill. Set the prompt size, the answer size and how many requests you expect, and every priced model is compared side by side.

Alle ToolsKorrektur vorschlagen