Skip to main content

Tools / Free, runs in your browser

Claude Token Counter & Cost Calculator

Paste a prompt to estimate its token count, then see exactly what it costs on Claude Opus 5.5, Fable 5.1, Sonnet 5, or Haiku 4.5, compared against GPT and Gemini.

Claude prices from the Anthropic pricing page, verified 09/28/2026. Nothing you paste leaves your browser.

~0 tokens, 0 words, 0 characters

0 input tokens. $10.00 a month on Opus 5.5.

Your receipt

Paste a prompt, or try the example. Your receipt shows up here, priced for the model you pick.

Change the assumptions

Reply length, tokens

Requests a month

Estimate only, not an exact tokenizer count. Averages a 4-characters-per-token heuristic with a word-based cross-check (char-based: 0, word-based: 0). Claude Opus 5.5 uses the newer Claude tokenizer, so the average is multiplied by 1.3 (Anthropic states approximately 30% more tokens for the same text). No error bound is published for this method; see how the estimate works. For an exact count, use the Messages API token counting endpoint.

Claude Code session cost

Enter the token counts from your own sessions: Claude Code's /cost command, or the usage fields of an API response (input_tokens, output_tokens, cache_read_input_tokens, cache_creation_input_tokens). Uses the model selected above (Claude Opus 5.5), at API list prices.

Per session
$0.0000
Per day
$0.0000
Per 30 days
$0.0000

Formula: cost per session = (uncached input x $4 + output x $20 + cache reads x $0.2 + cache writes x $5) / 1,000,000. Per day = per session x sessions per day. Per 30 days = per day x 30. Rates are Claude Opus 5.5 per million tokens from Anthropic's pricing page, verified 09/28/2026. This prices API usage only; it does not model a Claude subscription plan or its usage limits.

Why token count alone is not enough

Most token counters stop at a number. That number is only useful once you attach a price to it, because the same prompt can cost 10x more or less depending on which model you route it to. This tool exists to close that gap: count the tokens, then immediately see the dollar cost per request and per month, per model, side by side with what the same prompt would cost on GPT or Gemini.

If you are optimizing spend across a fleet of models, progressive disclosure cuts token usage 40-60% before you ever touch model choice. And if you are deciding which Claude tier to route a task to, the Fable 5 vs Opus 4.8 cost-per-task breakdown has the routing math.

This tool prices the API. For plan prices and limits, see Claude pricing, how Claude usage limits work and Claude Pro vs Max. For cached input, see what prompt caching costs on each model.

Claude tokenizer: browser estimate vs API count

Anthropic does not publish a downloadable tokenizer for its current models, so every online Claude tokenizer either estimates in the page or calls Anthropic's API. This page estimates, instantly and in your browser, which is enough to plan a budget or pick a model.

When you need a closer number, for example to check a prompt against a context limit, send it to the token counting endpoint with your API key. It counts the prompt with that model's tokenizer without running it, and it is free within rate limits. Anthropic still calls this count an estimate: billed input can differ by a small amount.

How the estimate works

Token estimate. The counter runs in your browser and does not call a tokenizer. It computes two figures, characters divided by 4 and words multiplied by 1.35, and reports their rounded average. That is an approximation with no published error bound, so treat it as a planning number. For an exact count, send the text to the Messages API token counting endpoint.

Newer tokenizer. Anthropic's pricing page states that Claude 4.7 and later models use a newer tokenizer that produces approximately 30% more tokens for the same text, and that the exact increase depends on content. For those models (Fable 5.1, Fable 5, Opus 5.5, Opus 5, Opus 4.8, Sonnet 5.5, Sonnet 5), this tool multiplies the estimate by 1.3. Haiku 4.5 uses the previous tokenizer and gets no adjustment.

Prices. Claude input and output rates come from https://platform.claude.com/docs/en/about-claude/pricing, verified 09/28/2026. Cache prices are computed from the multipliers on that page: a 5-minute cache write costs 1.25x the input price, a 1-hour cache write costs 2x, and a cache read costs 0.1x (0.05x on Opus 5.5, 0.025x on Fable 5.1). OpenAI and Google rates were last verified 07/21/2026 against their own pricing pages.

Shareable links. Copy link puts every input in the page address (for example ?model=sonnet-5&in=12000&out=800), so the copied link reopens the same estimate. Prompt text is never placed in the link.

Not included. Taxes, the Batch API discount, the 1.1x US-only data residency multiplier, fast mode pricing, tool-use and web search fees, and third-party cloud platform pricing. The session calculator prices API usage only and does not model a Claude subscription plan or its usage limits.

Questions

How accurate is this token counter?
It is an approximation, not an exact tokenizer count. It averages a 4-characters-per-token heuristic with a word-based cross-check, and no error bound is published for that method. Anthropic states that Claude 4.7 and later models produce approximately 30% more tokens for the same text, so the tool multiplies the estimate by 1.3 for those models. For an exact count, use the Messages API token counting endpoint before sending a request.
Why pair a token counter with a cost calculator?
Token counts alone do not tell you what a prompt costs. This tool multiplies your estimated input/output tokens by the current per-model rate so you can see the dollar impact of a prompt, a model choice, or a monthly volume before you commit to it.
Does this tool send my text anywhere?
No. Token counting and cost calculation run entirely in your browser with JavaScript. Nothing you paste is sent to a server or stored.
Which Claude model should I use for cost efficiency?
Haiku 4.5 is cheapest per token and fine for simple, high-volume tasks. Sonnet 5.5 is the mid-tier default for most production workloads. Opus 5.5 and Fable 5.1 cost more per token but handle harder reasoning in fewer retries, which can be cheaper in practice for complex tasks.
How are tokens calculated in Claude?
Claude splits text into tokens, which are common chunks of characters rather than whole words. In English a token is about 4 characters, or roughly three quarters of a word. Code, numbers and non-English text usually take more tokens per word. Claude 4.7 and later models use a newer tokenizer that produces about 30% more tokens for the same text. You pay for the input tokens you send and the output tokens Claude writes, at separate per-million rates.
Is there an official Claude tokenizer?
Anthropic does not publish a downloadable tokenizer for its current models. The closest count comes from the free token counting endpoint in the Claude API, which needs an API key and counts with the tokenizer of the model you name. This page gives an instant estimate in your browser instead, so your text never leaves your machine.
How much does a Claude prompt cost?
Multiply the input tokens by the input rate and the output tokens by the output rate, each quoted per million tokens. For example, 2,000 input tokens and 500 output tokens on Opus 5.5, at $4 in and $20 out per million, cost $0.008 plus $0.010, so $0.018 per request. At 1,000 requests a day that is $18 a day. Prompt caching and the Batch API lower it.
Does Claude Code use the same token pricing?
With an API key, Claude Code bills per token at the same API rates this tool uses. On a Pro or Max plan, Claude Code draws from the plan usage limit instead of billing per token, so this tool shows what the same work would cost on the API.

Stay in the loop

Get notified about new posts on AI, automation, and building in public.

No spam. Unsubscribe anytime.