Token Counter
Paste text (or upload a file) to count tokens and see exactly what it costs to send
to GPT, Claude, Gemini, DeepSeek and 600+ other models — using a real BPE tokenizer
(o200k_base), not a word-count estimate. Everything runs in your browser; nothing is uploaded.
Counts are exact for OpenAI models (o200k_base is GPT-4o/4.1/5's tokenizer). For Claude, Gemini and other vendors — whose tokenizers are not public — treat the count as a close estimate (typically within ±15%).
Cost of this text across popular models
| Model | Input $/1M | Output $/1M | This text (input) | +500 output tokens |
|---|
What is a token?
LLM APIs don't bill by word or character — they bill by token, the unit the model actually reads. A token is a common chunk of text: whole short words ("the", "and"), pieces of longer words ("token" + "izer"), punctuation, or whitespace. In English, one token averages about 4 characters or ¾ of a word, but the exact split depends on the tokenizer — which is why a real BPE count beats any rule of thumb.
This tool runs o200k_base, the byte-pair-encoding scheme used by OpenAI's current
models, directly in your browser. Your text never leaves the page.
FAQ
How accurate is this token counter?
For OpenAI models (GPT-4o, GPT-4.1, GPT-5 family) it is exact: we run the same o200k_base byte-pair encoding the API uses. Anthropic, Google and most other vendors do not publish their tokenizers, so for Claude, Gemini and others the o200k count is a close estimate — typically within about 15% of the billed figure.
Is my text uploaded anywhere?
No. The tokenizer is a JavaScript bundle that runs entirely in your browser. Nothing you paste or upload leaves your device — you can verify in your browser's network tab.
How is API cost calculated?
Cost = (input tokens ÷ 1,000,000) × the model's official input price, plus (expected output tokens ÷ 1,000,000) × the output price. Prices are official list prices in USD per million tokens, refreshed daily from Artificial Analysis data.
Why do tokens matter more than words?
Every LLM API bills per token, and context windows are measured in tokens. Two prompts with the same word count can differ meaningfully in tokens — code, non-English text and unusual formatting all tokenize differently.
How many tokens is a typical page of text?
A full English page (~500 words) is roughly 650-700 tokens. A rule of thumb is 1 token per 4 characters, but the whole point of this tool is that you don't need rules of thumb — paste the actual text and get the actual number.
Which models can I estimate costs for?
Every model in our comparison database that publishes pricing — 500+ models from OpenAI, Anthropic, Google, Meta, DeepSeek, Alibaba, Mistral, xAI and more. See the full sortable table on the Model Prices page.
Looking for full price and performance data on all models? See the model comparison table.