Claude Token Counter
Estimate tokens and cost for any text across every Claude model.
Your prompt
Private by design: your text never leaves your browser. Nothing is uploaded or stored.
Live counts
This is an estimate, not an exact count. Claude's own tokenizer is not available in a web page, so the number is worked out from your characters and words and can be off by roughly 15%, more for unusual text such as other languages or minified code. Exact counts come from Anthropic's token counting API.
Estimated cost by model
The cheapest model for your settings is highlighted. "Fits in context?" compares your prompt plus the expected output with each model's context window. Prices are in US dollars. Prices checked: October 2026. Always confirm on anthropic.com/pricing before you budget.
Prices used (USD per million tokens)
Claude Haiku 5.5 prices above apply to prompts up to 100K tokens. Above 100K tokens it costs $0.50 per million input tokens and $2.50 per million output tokens, and this tool switches to those prices automatically.
How to use it
- Paste your prompt, a file, or some code into the box. A small sample is already there, so you can see the numbers straight away.
- Watch the live counts: estimated tokens, characters, words and lines.
- Set how long you expect the reply to be (output tokens) and how many times you will send it.
- Pick "Cached prompt" if the same text will be sent again and again and you plan to use prompt caching.
- Read the table to compare what each Claude model would cost, and which ones the prompt fits into.
The text stays in your browser. Nothing is sent or saved.
How the pricing works
A token is a small chunk of text, often a short word or part of a longer one. Claude charges per million tokens, with one price for what you send (input) and a higher price for what it writes back (output). The cost of one request is:
input tokens / 1,000,000 x input price plus output tokens / 1,000,000 x output price
Example: a 1,000,000 token prompt on Claude Opus 5.5 costs 1 x $4.00 = $4.00 for the input. If the reply is 500 tokens, the output adds 0.0005 x $20.00 = $0.01, so one request is about $4.01. Send it 1,000 times and the total is 1,000 times that.
With prompt caching, text you send repeatedly can be stored. The first request pays a write price, which is 1.25 times the normal input price for the 5 minute cache or 2 times for the 1 hour cache. Later requests read from the cache at a much lower cache read price. On Opus 5.5 the cache read price is $0.20 per million tokens, so reading a 1,000,000 token prompt from the cache costs $0.20 instead of $4.00. Claude Haiku 5.5 has a lower price for prompts up to 100K tokens and a higher one above that, and the table above switches between them for you.
How to cut costs
- Use caching for long text you reuse, such as a big system prompt, a CLAUDE.md file or reference documents.
- Use a smaller model for simple jobs like sorting, summarising or formatting, and keep the big models for hard reasoning.
- Shorten the prompt. Remove repeated instructions, trim pasted logs to the relevant part, and ask for shorter answers, because output tokens cost more than input tokens.
FAQ
Is this the exact number of tokens Claude will count?
No. It is an estimate, usually within about 15% for normal English text and code. Claude's tokenizer cannot run in a web page. For an exact count, use Anthropic's token counting API, then type the result into the "Already know the token count" box.
Why do output tokens cost more than input tokens?
Anthropic sets a higher price for the text a model generates than for the text it reads. That is why a shorter answer can save more money than a shorter prompt.
Do the prices here stay up to date?
They were checked in October 2026 and are shown on this page. Prices change, so confirm on anthropic.com/pricing before you rely on them.
What does "fits in context" mean?
Every model can only handle a limited amount of text at once, called its context window. Claude Fable 5.1, Opus 5.5, Sonnet 5.5 and Haiku 5.5 have 1 million tokens. Claude Haiku 4.5 has 200,000. The check adds your prompt and your expected output together.
Is my text uploaded anywhere?
No. All the counting and maths happens in your browser, and there are no network calls.
Want to spend fewer tokens on every Claude Code task? Agentsforce ships 38 ready-made specialists, each focused on one job. This tool is independent and not affiliated with Anthropic.
More free tools
Give Claude Code a whole team. 38 specialists, one payment of $49.
Get Agentsforce