LLM Token Counter
Paste a prompt or document to count its tokens. OpenAI counts use the real o200k_base tokenizer running in your browser; Claude, Gemini and DeepSeek counts are clearly labelled estimates. You'll also see characters, words and the cost of sending it to a model.
OpenAI tokens
0
Exact, o200k_base
Characters
0
Words
0
Lines
0
| Model family | Tokens | Method |
|---|---|---|
| OpenAI (GPT-4o, GPT-5 family) | 0 | Exact — o200k_base tokenizer |
| Claude (Opus 4.7 and newer, Sonnet 5) | ~0 | Estimate — ~2.5 characters per token |
| Claude (Sonnet 4.6, Haiku 4.5) | ~0 | Estimate — ~4 characters per token |
| Gemini, DeepSeek and others | ~0 | Estimate — ~4 characters per token |
Only OpenAI publishes a tokenizer that runs in the browser, so other providers are clearly labelled estimates for English text. Code, non-English text and emoji usually use more tokens. Newer OpenAI models may use an updated tokenizer, so treat counts as very close rather than exact.
Estimated cost for this prompt
- Input (0 tokens)
- $0
- Output (500 tokens)
- $0.00500
- Total per request
- $0.00500
GPT-6 Sol: $2 input / $10 output per 1M tokens. Compare every model in the LLM API Cost Calculator.
Data last updated:
Results are estimates for planning only. Prices, limits and real-world usage vary — always confirm against the provider's official documentation or your own measurements before making decisions.
Why token counts matter
Large language models don’t read words or characters — they read tokens. Every API bill, context window and output limit is measured in tokens, so knowing how many your prompt uses tells you whether it will fit, how much it will cost and how much room is left for the answer. This token counter shows you exactly that, instantly and privately, in your browser.
How to use the token counter
- Paste your prompt, system prompt, document or chat transcript into the box.
- Read the exact OpenAI token count along with characters, words and lines.
- Compare the estimates for Claude, Gemini and DeepSeek in the table.
- Pick a model and enter the expected length of the reply to see the cost of one request.
- Tick “Show how the text is split into tokens” to see each token highlighted.
Exact counts and estimates
OpenAI publishes its tokenizers, so this tool runs o200k_base — the tokenizer used by the GPT-4o and GPT-5 families — directly in your browser. Counts for those models are exact, and newer GPT models are expected to be very close. The tokenizer (about 2 MB) is downloaded once, the first time you type.
Anthropic, Google and DeepSeek don’t offer tokenizers that run in a web page — they count tokens through their own APIs. For them, the tool gives a clearly labelled estimate based on the providers’ own guidance: roughly 4 characters per token for English text. Anthropic notes that Claude Opus 4.7 and later use a newer tokenizer that produces around 30% more tokens than earlier Claude models, and that 1 million tokens is roughly 2.5 million characters, so the estimate for those models uses about 2.5 characters per token. For billing-critical work, confirm counts with each provider’s token-counting endpoint.
What affects the number of tokens
- Language: tokenizers are most efficient for English; many other languages need noticeably more tokens for the same meaning.
- Code and data: brackets, indentation and long identifiers split into many small tokens.
- Numbers and emoji: long numbers and emoji often take several tokens each.
- Whitespace: repeated spaces and blank lines add tokens without adding meaning.
Tips to reduce token usage
- Trim boilerplate from system prompts, and remove examples the model doesn’t need.
- Send only the relevant sections of long documents instead of the whole file.
- Minify JSON you send to the model and ask for concise output formats.
- Reuse long, identical prompt prefixes so providers can cache them at a discount.
Costs here use the prices in our model table, last checked 2026-09-27. To estimate a whole month of usage across providers, use the LLM API Cost Calculator. Running models yourself? The GPU VRAM Calculator shows how much memory a given context length needs. For plain word and character counts, try the Word Counter.
Frequently asked questions
What is a token?
A token is the unit of text a language model reads and writes — often a word, part of a word, a punctuation mark or a space. In English, a token is roughly 4 characters or three-quarters of a word on average.
How accurate is this token counter?
OpenAI counts use o200k_base, the tokenizer of the GPT-4o and GPT-5 families, so they're exact for those models and very close for newer ones. Other providers don't publish a browser tokenizer, so their counts are estimates based on the providers' own characters-per-token guidance.
Why do Claude estimates show more tokens?
Anthropic says Claude Opus 4.7 and newer use a tokenizer that produces around 30% more tokens than earlier Claude models, and that 1M tokens is roughly 2.5M characters. The estimate reflects that.
Is my text sent to OpenAI or any server?
No. The tokenizer runs entirely in your browser. Your text never leaves your device.
Why do code and other languages use more tokens?
Tokenizers are trained mostly on English prose, so common English words are single tokens. Code symbols, rare words, emoji and many non-Latin scripts are split into more, smaller pieces.