AI Token Counter
Count tokens for ChatGPT, Claude and Gemini models. Exact OpenAI counts, cost per request and context window usage. Free, runs in your browser.
There is no public tokenizer for this model, so the count is an estimate made with OpenAI’s o200k_base tokenizer. The real number can be noticeably different, especially for non-English text and code.
- Input cost
- Output cost
- Total per request
·
Long-prompt pricing applies to this text.
Your input stays in your browser — nothing is uploaded to our servers.
Language models don’t read words, they read tokens. Every API bill, rate limit and context window is measured in them, so knowing how many tokens a prompt or document uses tells you what it will cost and whether it will fit. This token counter gives an exact count for OpenAI models, a clearly labelled estimate for the others, and the cost of one request at the provider’s published prices.
How to use the token counter
- Choose the model you plan to call.
- Paste your prompt, document or chat transcript, or click Try example.
- Read the token count, words, characters and tokens per word. The badge under the count says whether it is exact or an ≈ estimate.
- Enter how many tokens you expect back to see the input, output and total cost of the request.
- Tick Show how the text is split into tokens to see each token highlighted.
What is a token?
A token is a chunk of text from a fixed vocabulary that the model was trained with. Common English words are usually a single token; rare words, names, numbers, code and most other languages are split into several pieces. As a rough guide, English prose averages a little over one token per word, while Spanish, French, German or Portuguese text typically needs noticeably more tokens for the same meaning.
Each provider uses its own tokenizer, so the same text gives different counts on different models. OpenAI publishes its encodings, which is why counts for models that OpenAI’s tiktoken maps to o200k_base are exact here. Anthropic, Google and others don’t publish theirs for current models, so for them the tool estimates with o200k_base and labels the result “≈”.
Tokens matter in three places: cost (you pay per million input and output tokens), limits (the context window caps input plus output) and speed (longer outputs take longer to generate). Some providers also charge more per token once a single prompt passes a size threshold; when that applies to your text, the tool says so and uses the higher price.
Frequently asked questions
Is the token count exact?
For OpenAI models that OpenAI’s tiktoken library maps to the o200k_base encoding, yes: the count uses the same tokenizer. For other models there is no public tokenizer, so the number is an estimate made with o200k_base and is marked with “≈”. The real count can differ, especially for non-English text and code.
How can I get an exact count for Claude or Gemini?
Use the provider’s own counting endpoint: Anthropic’s Messages API has a count_tokens endpoint and the Gemini API has countTokens. They return the exact number for that model, but they require an API key and send your text to the provider, which this page never does.
Why does my text in Spanish, French or German use more tokens than English?
Tokenizers are built mostly from English-heavy training data, so English words are more often a single token. Words in other languages, especially long or accented ones, tend to be split into several pieces, so the same message costs more and fills the context window faster.
Does the cost include cached input, batch discounts or taxes?
No. The cost uses the standard per-token input and output prices from the provider’s official pricing page, plus any long-prompt tier that applies. Prompt caching, batch processing and regional pricing can lower or raise the real bill.
Is my text uploaded anywhere?
No. Tokenization runs in your browser with JavaScript. The tokenizer vocabulary is downloaded once from this site; your text never leaves your device.