AI tools

Claude Token Counter

Last UpdatedAugust 2026

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.

Tokens (est.)

0

Words

0

Characters

0

Sentences

0

Context window usage 0 of 1,000,000 tokens

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

Type or paste text above to see the estimated token boundaries.
01

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.

02

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.

03

How to count Claude tokens with this tool

  1. Pick your model. Context limits and prices differ enormously between Opus, Sonnet and Haiku.
  2. Paste your text. The count updates as you type.
  3. Set expected output tokens. Output costs five times input on most Claude models, so this drives the bill more than your prompt does.
  4. 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.

Claude token counter showing token count, context window usage and estimated Anthropic API cost
Token count, context usage and estimated cost update as you type, with separate tabs for image tokens and monthly volume modelling.
04

Estimating Anthropic API cost from your token count

input cost = (input tokens / 1,000,000) x input price output cost = (output tokens / 1,000,000) x output price total = input cost + output cost

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.

05

How many tokens does a Claude image use?

Images are converted to tokens by area. Anthropic's published approximation is:

tokens = (width px x height px) / 750

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.

06

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: ____________

ModelContextInput / 1MOutput / 1MCache readSuits
Claude Opus 4.81,000,000$5.00$25.00$0.50Complex reasoning, agents
Claude Opus 4.71,000,000$5.00$25.00$0.50Long multi-step workflows
Claude Sonnet 4.61,000,000$3.00$15.00$0.30Most production work
Claude Haiku 4.5200,000$1.00$5.00$0.10High-volume classification
Claude 3.5 Sonnet200,000$3.00$15.00$0.30Legacy, pinned deployments
Claude 3 Haiku200,000$0.25$1.25$0.03Legacy, cheapest option
07

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.

08

Claude token counter FAQ

It is an estimate. Anthropic has never published Claude's tokenizer, so no browser-based tool can be exact, including this one. It splits text the way tokenizers do and approximates the sub-word merges. Ordinary English usually lands close. Technical vocabulary and code drift further. For an exact number, use Anthropic's token counting API endpoint, which returns the true count for a request before you send it.
Yes. They use different tokenizer vocabularies, so identical text produces different counts. That is why you should not use a GPT counter to budget Claude calls. The difference is usually modest for plain English and larger for code, symbols and non-English text.
Somewhere around 1,300 to 1,400 tokens for ordinary English prose, though the figure moves with vocabulary and punctuation. Technical writing runs higher, and languages other than English can be several times higher again.
It depends on the model, and the table in section 06 lists what this tool is configured with. Verify against Anthropic's own pages before relying on it. Whatever the number, it covers everything at once: your system prompt, the full conversation so far, and the reply being written.
Roughly width times height divided by 750. A 1,024 by 768 image is about 1,050 tokens. Images over 1,568 pixels on the longest side are scaled down first, so very large images cost less than their raw dimensions suggest. The Image tokens tab calculates any size.
Prompt caching stores part of your context, usually a system prompt or a long reference document, so later requests can reuse it at a much lower rate per token. The saving is largest when the cached portion is big and the request volume is high. Check the current cached-read rate on Anthropic's pricing page, since it is the number that determines whether it is worth enabling for you.
No. Everything runs in your browser. There is no server behind this tool, no account and no API key. Disconnect from the internet and the counter keeps working, which is the easiest way to prove it to yourself.
Haiku is the cheapest of the current models and the legacy Haiku cheaper still. But the cheapest model is only the right answer when the task is simple. Model choice is usually the biggest cost lever available, so route easy work down and keep the flagship for what actually needs it.
Yes. No account, no sign-up, no usage limit. It runs on your own device, so there is nothing for us to meter.
09

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.

Aayush Kulshrestha, founder of Calcxi

Written & verified by

Aayush Kulshrestha

B.Tech Computer Science · 8 years in web development & SEO · Bhilwara, India
About · LinkedIn · Report an error