AI Token Counter
Count OpenAI tokens exactly and estimate tokens for Claude, Gemini, Llama, Qwen, and DeepSeek.
How to use
Paste text and choose a model family. OpenAI models use the bundled o200k_base or cl100k_base tokenizer for exact counts; enable token boundaries to inspect each token. Claude, Gemini, Llama, Qwen, and DeepSeek are clearly labeled estimates because their production tokenizers are not bundled here.
o200k_base is the official tokenizer for GPT-4o through GPT-5.x and gpt-oss. OpenAI has not published an encoding for GPT-6.x yet, so treat o200k counts for it as a close reference. Claude 4.7 and later use a newer tokenizer that produces about 30% more tokens than Claude 4.6 and earlier, so the two are separate options.
Estimates count Unicode characters and use roughly 4 Latin characters or 1.7 CJK characters per token, with a small family calibration. The cost hint uses one named reference model per family and is directional only.
FAQ
Which token counts are exact?
Counts for the o200k_base and cl100k_base options are computed with js-tiktoken and are exact for the models those encodings belong to (GPT-4o through GPT-5.x for o200k). For GPT-6.x, which has no published encoding yet, o200k is a close reference. Every other family is explicitly shown as an estimate.
Why can an estimate differ from a provider console?
Providers use different tokenizers and may add chat, tool, image, or system-message overhead that plain-text estimation cannot see.
Does the counter upload my prompt?
No. Tokenization and estimation run entirely in your browser.