LLM Token Counter
Paste any text to count its tokens for GPT-5.6, Claude, and Gemini models, and see what it costs to send.
- Free
- No account
- Runs in your browser
- Nothing uploaded
At Claude Opus 5 pricing: $0 as input, or $0 if the model generated this much. This vendor doesn't publish a tokenizer for this model, so the count is a ~4-characters-per-token approximation.
Runs entirely in your browser — your input is never uploaded, logged, or stored.Privacy policy
What is LLM Token Counter?
Language models don't read characters or words — they read tokens, sub-word chunks produced by a tokenizer. Every API prices per token and limits context per token, so the token count is the number that determines both what a request costs and whether it fits. This tool takes your text, counts it for the model you select, and shows the cost at that model's current published rate.
Token counts are not transferable between model families. The same sentence is 10 tokens for GPT-5.6 and 11 for Claude Opus 5 in this tool, and the gap widens on code, JSON, and non-English text, where tokenizers diverge most. Budgeting with one model's count while calling another is a reliable way to be wrong about cost.
It is for developers and prompt engineers sizing prompts before shipping: estimating spend on a batch job, checking whether a document fits, or comparing what the same workload costs across vendors. If what you need is whether a prompt fits a model's context window and how much room is left for the reply, use the Context Window Calculator instead — it answers that question directly.
For OpenAI models the tool runs o200k_base, the newest published tiktoken encoding, over your text. For Claude and Gemini it uses the ~4-characters-per-token approximation those vendors publish, rounded up so a partial token is never dropped. Cost is the resulting token count divided by one million, multiplied by the model's published per-million-token rate — shown both as an input cost and as what the same number of tokens would cost had the model generated them, since output is billed several times higher than input on every current model.
| Model | Input $/M tokens | Output $/M tokens | How tokens are counted here | |
|---|---|---|---|---|
| GPT-5.6 Sol | $5.00 | $30.00 | o200k_base (proxy) | |
| GPT-5.6 Terra | $2.00 | $12.00 | o200k_base (proxy) | |
| GPT-5.6 Luna | $0.20 | $1.20 | o200k_base (proxy) | |
| Claude Opus 5 | $5.00 | $25.00 | ~4 chars/token estimate | |
| Claude Sonnet 5 | $3.00 | $15.00 | ~4 chars/token estimate | |
| Claude Haiku 4.5 | $1.00 | $5.00 | ~4 chars/token estimate | |
| Gemini 3.6 Flash | $1.50 | $7.50 | ~4 chars/token estimate | |
| Gemini 3.1 Pro | $2.00 | $12.00 | ~4 chars/token estimate |
Worked examples
- 'The quick brown fox jumps over the lazy dog.' → 10 tokens on GPT-5.6 Sol, costing $0.000050 as input.
- The same sentence → 11 tokens on Claude Opus 5. The difference is the counting method, not the sentence.
- A 4,000-character prompt → 1,000 estimated tokens on Claude Opus 5 ($0.0050 input, $0.0250 output) but 801 tokens on GPT-5.6 Sol ($0.0040 input) — the character estimate rounds less favourably than a real encoding.
- The same 4,000-character prompt on GPT-5.6 Luna → 801 tokens for $0.000160 as input, roughly 25× cheaper than Sol for identical text.
How to use LLM Token Counter
- Paste or type the text you plan to send into the input box.
- Select the model you are targeting — counts and prices differ between families.
- Read the token count, and the cost shown for that many tokens as input or as output.
- To check whether the prompt fits the model's context window, use the Context Window Calculator.
Common errors
- Token count doesn't match your character or word count — expected. Tokens are sub-word units; a long word can be several tokens and a common word is usually one.
- The count changes when you switch models — also expected, and the point of the model selector. OpenAI models are counted with a real encoding, Claude and Gemini with a character-based approximation.
- Your provider's billing shows a different number — these are planning estimates from published proxies, not billing figures. Use the vendor's own token-counting endpoint when it has to be exact.
- A price looks out of date — vendors change pricing without notice. The date this table was verified is shown on the page; check the vendor's pricing page before relying on it.
- Very large pastes (100k+ characters) make the box sluggish — tokenising in the browser is CPU-bound. Split the text and add the counts together.
FAQ
How do I count tokens for an LLM prompt before calling the API?
Paste the exact text you plan to send — system prompt, examples, and user message together — and select the model you are calling. The token count is what that request will be billed on, and what counts against the context window.
How accurate is this token count?
It is a planning estimate, and the tool shows which method produced it. OpenAI models are counted with o200k_base, the newest published tiktoken encoding — close, but not guaranteed exact for GPT-5.6. Claude and Gemini use the ~4-characters-per-token approximation their vendors publish, because neither releases a tokenizer for their current models. For a billable number, use Anthropic's count_tokens endpoint or the usage returned on a real API call.
Why does the same text give different token counts on GPT and Claude?
Each model family uses a different tokenizer with its own vocabulary, so identical text splits into different sub-word units. In this tool the difference is larger still, because OpenAI models are counted with a real encoding while Claude and Gemini use a character-based approximation.
Is a token the same as a word?
No. A token averages roughly three-quarters of an English word, but that ratio is only an average. Punctuation, numbers, whitespace, code, and non-English text all tokenise differently, and a single long word can become several tokens.
Why is the output price higher than the input price?
Every current model charges more for tokens it generates than for tokens it reads — commonly five to six times more. The tool shows both, because a prompt that looks cheap to send can be expensive if it produces a long reply.
Does this tool send my text anywhere?
No. Counting happens entirely in your browser. Nothing you paste is uploaded, logged, or stored, which is why the tool works with the network disconnected.
Related tools
- JSON FormatterPaste your JSON below to format, validate, and beautify it instantly.
- Context Window CalculatorPaste your prompt, pick a model, and see how much of its context window you use and how many tokens remain for the reply.
- Embedding Dimension CalculatorEnter your embedding count and dimensions to see exactly how much storage you need across every precision level.
Prefer AllUtil on Google
One click adds AllUtil to your Google preferences. You'll see our tools highlighted with a Preferred badge in Search and AI answers.