AI Token Counter
Count the exact number of tokens in a prompt using OpenAI's own BPE tokenizers (cl100k and o200k), entirely in your browser. See tokens, characters, and words, and estimate cost — no API key, nothing uploaded.
Exact for OpenAI models. Claude and Gemini use different tokenizers, so counts there are approximate. Estimate cost with the token cost calculator. Runs fully in your browser — no API, no cost.
About AI Token Counter
Language models don't read characters — they read tokens, chunks of roughly ¾ of a word. Knowing a prompt's token count tells you whether it fits a model's context window and what it will cost. This counter runs OpenAI's actual BPE tokenizers (cl100k_base for GPT-4/3.5, o200k_base for GPT-4o and o-series) locally in your browser, so the count is exact for those models and nothing is sent to any server or API.
Frequently asked questions
Is this exact or an estimate?+
For OpenAI models it's exact — it uses the same cl100k_base / o200k_base tokenizers OpenAI uses. Claude and Gemini use different tokenizers, so treat the count as a close approximation for those.
Does it call an API or cost anything?+
No. The tokenizer runs entirely in your browser. There's no API key, no request, and no cost — your text never leaves your device.
Why does token count matter?+
Models bill per token and have a fixed context window. Counting tokens lets you check a prompt fits and predict cost before you send it.