Token counter
LLMs bill by tokens and measure context in tokens. Paste some text to see how many tokens it has and how a model splits it.
- Tokens
- 0
- Characters
- 0
- Characters per token
- —
Claude, Gemini and Chinese models use their own tokenizers, so their counts differ. Text never leaves your browser.
How to use it
- Pick a tokenizer:
o200k_baseis used by GPT-5, GPT-4.1, GPT-4o, o1 and o3;cl100k_baseby GPT-4 and GPT-3.5 Turbo (from the model table in OpenAI's tiktoken source). - Paste text; the count updates as you type.
- Tick "Show how the text is split" to color every token. English, Chinese, code and whitespace split very differently.
- Click "Price this many input tokens" to open the AI API cost calculator with your count.
Counting happens in your browser; your text is never sent anywhere. The tokenizer (about 2 MB) loads once from jsDelivr.
FAQ
Are counts the same for Claude, Gemini or DeepSeek?
No. Each vendor uses its own tokenizer, so counts differ. This tool is exact for OpenAI models; for others, treat it as a ballpark and rely on the usage numbers their APIs return.
How do tokens relate to context length?
A model's context window is the maximum number of tokens it can handle at once. See which models fit your text in the context window lookup.