AI tools
Claude Token Counter
Paste a prompt into this Claude token counter to see roughly how many tokens it uses, how much of the model's context window that fills, and what an Anthropic API call would cost. It also estimates image tokens and prompt caching savings, and it runs entirely in your browser.
It is an estimator, not Anthropic's tokenizer. Section 02 sets out exactly how close it gets and where it drifts, because a token counter that hides its own margin of error is no use to anyone budgeting an API bill.
System: 0 tokens
Human: 0 tokens
Every API message carries a little extra for role formatting, so the total here sits slightly above the raw text. The system prompt is the one that matters: it is resent on every single call, which is why it gets its own counter.
Tokens (est.)
0
Words
0
Characters
0
Sentences
0
Estimated Anthropic API cost
Input
$0.000000
Output
$0.000000
Total
$0.000000
With caching
$0.000000
Using Claude Sonnet 4.6 with 500 output tokens. Prices are per million tokens as configured here and have not been verified against Anthropic's pricing page. See section 06.
Token boundaries
What is a token in Claude?
Claude does not read your prompt word by word. It breaks text into tokens, chunks of characters drawn from a vocabulary the model was trained with. A token is often a whole word, but not always.
Common word
One token. "the", "run", "because" each cost a single token because they appear constantly in training text.
Rare or long word
Several tokens. Technical terms, unusual names and compound words get split into pieces.
Code
More tokens per character. Brackets, operators and indentation all cost, and deep nesting adds up fast.
Other languages
Often several times more tokens than English for the same meaning, because the vocabulary is English-heavy.
Picturing a million tokens. Roughly 750,000 English words. For scale, the seven Harry Potter novels run to about 1,084,000 words, so a full million-token context holds around two thirds of the series. All seven would need close to 1.45 million tokens.
How accurate is this Claude token counter?
Straight answer: it is an estimate, and here is why no browser tool can do better.
Anthropic has never published Claude's tokenizer. Unlike OpenAI, which released tiktoken, there is no official vocabulary file anyone can load. Every Claude token counter on the internet, including this one, is guessing to some degree. Any page telling you it is "the most accurate" cannot support that, and this page used to be one of them.
What this tool actually does
It splits your text on word, digit, punctuation and whitespace boundaries, then estimates how each piece would be broken down further. Common short words come out right. Long technical vocabulary is where estimation gets hard, and where any tool of this kind drifts.
How to get an exact number
Anthropic provides a token counting endpoint in its API that returns the true count for a request before you send it. It costs nothing to call. If you are sizing a production system or billing a client, use that. If you want to know whether a prompt is roughly 800 tokens or roughly 8,000, this page will tell you.
Claude and ChatGPT tokenise differently, so the same text produces different counts on each. Do not use a GPT counter to budget Claude calls or the other way round. There is a ChatGPT token counter here for the OpenAI side.
How to count Claude tokens with this tool
- Pick your model. Context limits and prices differ enormously between Opus, Sonnet and Haiku.
- Paste your text. The count updates as you type.
- Set expected output tokens. Output costs five times input on most Claude models, so this drives the bill more than your prompt does.
- Watch the context bar. Past 80 percent you are near the point where the earliest messages start dropping out.
Use System + Human for API work
A system prompt is sent again with every request. Two thousand tokens of system prompt across fifty thousand calls is a hundred million input tokens you may never have counted. Splitting the two apart shows which half is the recurring cost.
Estimating Anthropic API cost from your token count
The detail that catches people out is the ratio. On Claude models output is priced at five times input. A model that answers at length costs far more than the prompt suggests, and asking for concise answers is a real cost lever, not just a style preference.
The second one is conversation growth. Every turn resends the entire history as input, so message twenty costs far more than message one even if you typed the same number of words.
How many tokens does a Claude image use?
Images are converted to tokens by area. Anthropic's published approximation is:
Images larger than 1,568 pixels on the longest side are scaled down first, so the token cost stops rising past that point. A 1,024 x 768 image works out at roughly 1,050 tokens. A 4K photo is resized before counting, so it does not cost four times a Full HD one.
Two corrections to what this page used to say. It described a formula of "1,601 tokens per 512 x 512 tile plus 85 base", then gave worked examples that did not match its own formula: 1,024 x 768 was listed as 1,334 tokens where that formula gives 6,489. The tile-plus-base shape belongs to OpenAI's vision pricing, not Anthropic's. It has been replaced with the area formula above.
Formula verified against Anthropic's vision documentation on: ____________
Fill that date in after checking the Anthropic vision documentation yourself. This session could not open it.
Claude model context windows and API pricing
These prices are unverified. This session could not open Anthropic's pricing page, so not one figure below has been checked. The previous version of this page said "verified June 2026", which was not true. Check every row at anthropic.com/pricing and fill in the date.
Last verified against anthropic.com/pricing: ____________
| Model | Context | Input / 1M | Output / 1M | Cache read | Suits |
|---|---|---|---|---|---|
| Claude Opus 4.8 | 1,000,000 | $5.00 | $25.00 | $0.50 | Complex reasoning, agents |
| Claude Opus 4.7 | 1,000,000 | $5.00 | $25.00 | $0.50 | Long multi-step workflows |
| Claude Sonnet 4.6 | 1,000,000 | $3.00 | $15.00 | $0.30 | Most production work |
| Claude Haiku 4.5 | 200,000 | $1.00 | $5.00 | $0.10 | High-volume classification |
| Claude 3.5 Sonnet | 200,000 | $3.00 | $15.00 | $0.30 | Legacy, pinned deployments |
| Claude 3 Haiku | 200,000 | $0.25 | $1.25 | $0.03 | Legacy, cheapest option |
How to reduce Claude token usage
Cache the system prompt
Anthropic offers prompt caching, which charges cached reads at a fraction of the normal input rate. If the same system prompt goes out on every call, this is the single largest saving available and it requires no change to your prompt at all. Check the current discount on Anthropic's pricing page.
Batch anything that is not real time
The Batch API trades response speed for a lower rate. For document processing, extraction pipelines and content queues, nothing about the output changes.
Bullets, not prose
"Please make sure that you carefully handle all potential edge cases" and "Handle all edge cases" give the same instruction. One is roughly a third the length.
Send simple work to Haiku
Classification, routing and extraction rarely need the flagship model. Routing the easy half of a mixed workload to the cheapest model is usually the second biggest saving after caching.
Retrieve chunks, not documents
In a retrieval system, send the passages that matter rather than the whole file. Most of a long document contributes nothing to the answer and all of it is billed.
Start fresh rather than arguing
A new conversation with a two line summary beats a forty message thread that has drifted, and costs a fraction as much.
Claude token counter FAQ
Limits, sources and independence
What this tool cannot do
It cannot give an exact token count, because Anthropic does not publish the tokenizer. It cannot see your actual API usage, account for tool definitions, extended thinking, or PDF and document handling, and it has no way to predict how long a reply will be. Every figure here is an estimate you should sanity-check before you spend money on it.
What has and has not been verified
The token estimation method is described openly in section 02 and is this tool's own approximation, not a third-party library. Prices, context windows and the image formula have not been verified from this session, because Anthropic's pricing and documentation pages could not be opened. Sections 05 and 06 each carry a blank verification line for that reason. An earlier version of this page claimed these figures were verified in June 2026 and cited outside articles that did not support them. Both have been removed.
Not affiliated with Anthropic
Calcxi is an independent website. We are not affiliated with, endorsed by or sponsored by Anthropic PBC. "Claude", "Opus", "Sonnet" and "Haiku" are trademarks of Anthropic, referred to here only to describe what this tool estimates. Nothing here is a quote and no figure is a guarantee of what you will be charged.
Related tools on Calcxi
Written & verified by
B.Tech Computer Science · 8 years in web development & SEO · Bhilwara, India
About ·
LinkedIn ·
Report an error