LLM Token Counter
Count tokens for GPT, Claude and Gemini models, check the context window left, and see how one Chinese character can cost 0.6 or 1.2 tokens depending on the model.
100% private — everything runs in your browser
How to Use
- 1
Paste the prompt, document chunk or conversation you intend to send into the text box.
- 2
Choose the model you will call. Every GPT-4o and GPT-5 generation model shares one vocabulary, GPT-4 and GPT-3.5 share an older one, and Claude and Gemini keep theirs private, so their counts stay estimates.
- 3
Read the token count, the character and word totals, and how much of the model context window the text fills.
- 4
For OpenAI models, press "Count exactly" to download the real BPE vocabulary and get the same number the API would report.
- 5
If the bar turns red, split the input, shrink the retrieved chunks, or move to a model with a larger window.
Examples
English sentence — 44 characters
Input
The quick brown fox jumps over the lazy dog.Output
10 tokens · 44 characters · 9 wordsThe same sentence in Chinese, counted with two vocabularies
Input
今天天气很好,我们出去玩吧。 (14 characters)Output
9 tokens on o200k_base (GPT-4o, GPT-5, o3)
17 tokens on cl100k_base (GPT-4, GPT-3.5)
Same meaning, same model family, 1.9x the cost.Mixed-language prompt
Input
Hello, world! 你好世界Output
7 tokens exact on o200k_base
10 tokens exact on cl100k_base
7 tokens estimatedFAQ
What is a token?
A token is the unit a language model reads and writes — a fragment of a word rather than a whole word. English text averages roughly 1.1 tokens per word, so about four to six characters make one token. Common words usually become a single token, rare words split into several ("tokenizer" becomes "token", "iz", "er"). Pricing, rate limits and the context window are all measured in tokens, never in words or characters, which is why the count matters before you call an API.
How many tokens is one Chinese character?
It depends entirely on the model, and the common "one character equals one token" rule is now wrong for the newest models. Counted against the real vocabularies, the 14-character sentence 今天天气很好,我们出去玩吧。 comes out at 9 tokens on o200k_base (GPT-4o, GPT-5, o3 and later) but 17 tokens on cl100k_base (GPT-4, GPT-3.5). OpenAI enlarged the Chinese coverage of its vocabulary in 2024, so Chinese text costs roughly 0.6 tokens per character on current models and about 1.2 on legacy ones. Japanese and Korean behave the same way.
Why does my estimate differ from the number the API billed me?
Three reasons. First, the default count is a statistical estimate fitted on real data — about ±10 % on single-language text and up to ±25 % when a prompt mixes Latin, Chinese, Japanese and Cyrillic scripts. Second, a chat request is not just your text: the provider wraps it in control tokens for the role messages, and reasoning models bill hidden thinking tokens you never see. Third, vocabularies change with model generations. Press "Count exactly" to remove the first source of error completely.
Do you upload my text?
No. The estimate runs on a small script and the exact count downloads an open Byte-Pair-Encoding vocabulary of about 1 MB, then splits your text locally in this tab. The text never leaves your device, and nothing is sent to any server after that file is cached.
Can you count Claude or Gemini tokens exactly?
Not from a public vocabulary. Anthropic and Google have never published their tokenizers, so every website claiming an exact Claude or Gemini count is estimating too. This tool applies a profile calibrated against real OpenAI counts and labels the result an estimate. One trap worth knowing: Claude 4.7 and every later Claude model use a newer tokenizer, so identical text bills more tokens than on 4.6 and earlier — by Anthropic’s own numbers, up to about 35 % more. For a real number use Anthropic’s /v1/messages/count_tokens endpoint or Google’s countTokens endpoint, both of which return the provider’s own count.
What is a context window and how much room do I actually have?
The context window is the combined budget of the prompt plus the generated answer, measured in tokens. A 128k-window model does not give you 128k of prompt: the system prompt, tool definitions, retrieved documents and the reserved output all come off the top. As of October 2026 the current windows are 400k for GPT-5 through 5.3, about 1M for GPT-5.4 to 5.6 and GPT-6, 1M for Claude Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.1, and 1,048,576 for Gemini 4 Argon — which Gemini counts across input, thinking and output together. The bar under the counter subtracts your text from the window you set, so type the smaller prompt budget if your provider publishes one.
Does it count image, audio or tool definitions?
Only characters. Images, audio and PDF pages are billed by their own rules — an image is usually converted into a patch count that scales with resolution, not with the text you can read in it. Tool and function schemas do consume text tokens: enter the JSON schema into this counter to size that cost.