Token Counter

Count tokens in your text with the LLM tokenizers cl100k_base and o200k_base while checking your context window usage at the same time. GDPR-compliant.

The result will appear here …

How to use this tool (video)

This video is hosted on YouTube. When you play it, data may be sent to Google.

Token Counter for LLMs: Count Tokens in Your Text

Token counts matter when you work with GPT, ChatGPT, Claude, Gemini and other language models. A token is a small piece of text that a model processes, often a word fragment, a space or punctuation rather than a whole word. This token counter supports both modern tokenizers, cl100k_base (GPT-4, GPT-3.5) and o200k_base (GPT-4o, GPT-4.1, o1, o3), shows the context-window capacity and runs entirely in your browser, so your text is never sent anywhere.

Why count tokens?

AI APIs typically charge and limit requests by input and output tokens. Because a token is usually a word fragment rather than a complete word, the token count differs from the character or word count. Knowing how many tokens your prompt produces helps you stay inside a context window, estimate API costs before a request and shorten text that would otherwise not fit.

A rough rule of thumb

For English prose, one token corresponds to roughly 4 characters or 0.75 words. German and other languages with many compound words often need a little more per sentence. Each model family uses its own tokenizer, so the exact number can vary between providers even for the same text.

Context windows

Models such as GPT-4o offer a context window of 128,000 tokens, Claude models reach 200,000 and Gemini variants go up to 1,000,000 tokens. The counter shows how much of the selected model window your text occupies, colored from green (low) over yellow (medium) to red (critical).

Tokens vs. characters

A common mistake is to treat tokens and characters as the same thing. A plain character counter (like our word counter) counts every position on its own, while the token count depends on how frequent and how combined the characters are. Common words such as the or ist are often a single token, rare words are split into several.

Frequently asked questions

How do I count the tokens in my text?

Simply paste your text into the input field. The counter immediately shows the estimated token count plus the percentage share of the selected model context window, together with words, characters and further values.

What is the difference between tokens and characters?

A token is a word fragment, not a single character. A character counter counts every single position, while the token count depends on the frequency and combination of the characters. Common words are often a single token, while rare words are split into several.

How accurate is the token counter?

It uses the official cl100k_base (GPT-4, GPT-3.5) and o200k_base (GPT-4o, GPT-4.1, o1) tokenizers, so it is very precise for these models. You can choose the tokenizer inside the tool. For other models the exact number can differ slightly, but the estimate stays reliable.

Why does the tool show context window usage?

Models like GPT-4o can only process a limited amount of text at once. The colored display shows how much of the context window your text occupies, from green (low) over yellow (medium) to red (critical). This helps you see whether your text still fits.

Are my texts sent to a server?

No. All token counting runs directly in your browser using a local tokenizer. Your text is never uploaded, saved or processed anywhere else.

How many tokens does a text cost in API billing?

Most AI APIs bill input and output separately by tokens. The counter helps you estimate the approximate costs before a request by showing the token count of your prompt.

Read more about this tool

How the counter counts tokens

Our token counter uses Byte-Pair-Encoding (BPE), the same method behind OpenAI tiktoken. In a first pass your text is broken into single bytes, then the most frequent character pairs are merged again and again until the stable word pieces that the model knows remain. You can switch between two official tokenizers: cl100k_base with about 100,000 entries (GPT-4, GPT-3.5) and o200k_base with roughly 200,000 entries (GPT-4o, GPT-4.1, o1, o3). The long example word antidisestablishmentarianism, for instance, splits into six tokens with cl100k_base. Because every model family uses its own tokenizer, the same line of text can produce slightly different token counts across providers.

How to use the counter: paste your text into the input field and click Count. The tool shows the estimated token count, the share of the selected model context window, plus words, characters and lines. If you switch the tokenizer or the target model, it recalculates, so you can compare different models side by side.

How tokenization works for language models

A language model does not read letters, it reads a sequence of numbers. Every token is an entry in a fixed vocabulary and carries its own ID. Tokenization translates your text into exactly this sequence so the model can compute a probability for every following token. Common words such as the or and are often a single token, while rare words, compound nouns and special characters are split into several pieces. That is why capitalization, spaces, blank lines, emojis and code count differently than plain letters.

As a rule of thumb for English prose, one token equals about four characters or 0.75 words. That number decides both how much text fits into a model context window and how much an API request costs, because billing is split between input and output tokens. Keeping an eye on the token count pays off before large or repeated prompt series.

Does the calculation really run locally?

Yes, entirely. All tokenization happens right in your browser with a local tokenizer and no server contact. Your text is never uploaded, never cached and never processed anywhere else. You can safely check sensitive or confidential content without any worry.