99tools

LLM Token Counter

runs in your browser

Count tokens exactly as GPT-5, GPT-4o and GPT-4 do (o200k and cl100k), see where each token breaks, and check a prompt against a limit. Nothing uploaded.

Tokenizer

o200k is the tokenizer of GPT-5, GPT-4.1, GPT-4o, o1, o3 and o4-mini.

Text

Count

Loading the o200k vocabulary…

Loading the o200k vocabulary…

Characters
0
Words
0
Lines
0
Characters per token
–

Claude’s tokenizer is not published, and Gemini’s and Llama’s are not included here. By the usual rule of about four characters per token, this is roughly 0 tokens for English; for code and other languages that estimate can be far off. Anthropic and Google offer token-counting endpoints for an exact figure.

Tokens

Each token appears here as its own block, with spaces shown as · and line breaks as ↵.

about this tool

How many tokens is this?

Language models do not read letters or words; they read tokens — pieces of text from a fixed vocabulary, often a whole common word with the space before it, sometimes a fragment of a rarer one. Context windows, rate limits and API prices are all counted in tokens, so the number that matters for a prompt is not its length in characters but how the model's tokenizer splits it.

Paste the text and the count appears as you type, exactly as OpenAI's own tokenizer gives it. Past 50,000 characters, or with a run of several thousand characters and no break — Thai, unpunctuated Chinese, a line of dashes — it waits for you to press Count tokens, since splitting a long unbroken run can take the tokenizer several seconds. o200k is the vocabulary of GPT-5, GPT-4.1, GPT-4o, o1, o3 and o4-mini; cl100k is that of GPT-4, GPT-3.5 Turbo and the text-embedding-3 models.

See where the tokens break

Each token is drawn as its own block, with spaces shown as · and line breaks as ↵, so you can see why a prompt costs what it does: a long identifier split into five pieces, a number cut every three digits, a non-Latin script spent a token or more per character. Switch on show token ids for the numbers the model receives, and Copy ids for them as a JSON array. Only the first 2,000 tokens are drawn; the count always covers all of it.

Against a limit

Type a limit — 8k, 128k, 1M — and the page says what share of it the text takes and how much is left, or how far over it is. Keep in mind that an API request adds a few tokens per message for roles and separators, and more for tools and images, on top of the text counted here.

Other models

Claude's tokenizer is not published, and Gemini's and Llama's are not included here, so the page does not pretend to count for them. It shows the usual rule of thumb instead — about four characters per token, which is close for ordinary English and can be well off for code and other languages. Anthropic and Google offer exact counting through their APIs.

Private

The vocabulary is downloaded once, and every token is counted in your browser: what you paste is never sent anywhere. For a plain word and character count, use the word counter; to see the invisible characters that can add tokens to a pasted prompt, the Unicode inspector.

questions

Which models does this count exactly for?
OpenAI models. The o200k tokenizer is the one GPT-5, GPT-4.1, GPT-4o and the o-series reasoning models use; cl100k is the one GPT-4, GPT-3.5 Turbo and the text-embedding-3 models use. The count is the same one the models’ own tokenizer gives, which is what an API bills for the text itself.
Can it count tokens for Claude, Gemini or Llama?
Not exactly. Claude’s tokenizer is not published, and Gemini’s and Llama’s are not included here, so the page gives only the rough rule of about four characters per token, which holds for ordinary English and can be far off for code and other languages. Anthropic and Google offer token-counting endpoints in their APIs for an exact figure.
Why does a chat message cost more tokens than its text?
An API wraps each message in a few tokens of its own that mark the role and where the message ends, and a system prompt, tool definitions and images add more. This counts the text you give it, which is the part you write; expect a request to come to a little more.
Why do some languages take so many more tokens?
A tokenizer learns its vocabulary from text, mostly English, so common English words are a token each while words in other scripts are split into several pieces, or into raw bytes. The newer o200k vocabulary is far kinder to Hindi, Japanese and other scripts than cl100k: paste the same text and switch between them to see.
What do the shaded blocks show?
Each block is one token, in the order the model reads them, with spaces shown as · and line breaks as ↵. Notice that a word usually carries the space before it. Where one character is split across several tokens — some emoji and rare characters are — the block holds all of them. Switch on show token ids to see the numbers the model actually receives.
Is my text uploaded?
No. The tokenizer and its vocabulary are downloaded to your browser once, and the counting happens there. Nothing you type is sent anywhere.