Hypermile

Free tool · Estimates only

Claude token calculator & token counter

Paste text for a heuristic token estimate, then price input and output against API rates baked in as of August 2026. All math runs in your browser — no uploads, no external requests. This estimates API dollars, not Claude Code’s subscription 5-hour / weekly caps (see usage limits).

Token counter

Heuristic: English-ish text ≈ characters ÷ 4. Newer Claude models (Sonnet 5, Opus 4.7+) may tokenize ~30% denser — toggle below. Not a substitute for the provider tokenizer.

Characters
0
Estimated tokens
0

API cost calculator

Enter token counts (or push them from the counter). Optional cache-read share models prompt-caching savings when the provider supports it.

Estimated input cost
$0.000000
Estimated output cost
$0.000000
Estimated total
$0.000000

Model pricing table (baked in)

USD per million tokens, as of August 2026. Confirm against Anthropic and OpenAI before production budgeting.

As of 28 August 2026, Anthropic’s pricing docs state that the $2/$10 per million input/output rates for Claude Sonnet 5 — announced at launch as introductory through 31 August 2026 — are now the standard price. The previously scheduled increase to $3/$15 on 1 September 2026 will not occur. That comes from Anthropic’s pricing docs, not a third-party recap. Still confirm live rates before you budget production spend.

Model Input / MTok Cache read / MTok Output / MTok
Claude Sonnet 5 — Standard $2/$10 per million input/output; cache reads 0.1× input. $2.00 $0.20 $10.00
Claude Sonnet 4.6 $3.00 $0.30 $15.00
Claude Opus 4.6 / 4.7 / 4.8 $5.00 $0.50 $25.00
Claude Haiku 4.5 $1.00 $0.10 $5.00
GPT-5.3 Codex — Codex API list rates, including cached input; not ChatGPT subscription metering. Confirm on OpenAI’s pricing page. $1.75 $0.175 $14.00
GPT-4.1 $2.00 $0.50 $8.00
o3 $2.00 $0.50 $8.00

How to use this for Claude Code

If you pay the API directly, these estimates help you size a session before you run it. If you use Claude Code on a Pro or Max subscription, dollars are the wrong unit — you are racing a 5-hour window and a weekly cap. For what counts toward subscription burn (including cache-read weighting), see Claude Code token usage.

To see where your sessions burn tokens, run the free local audit CLI, then download Hypermile that forecasts the cap and trims noisy prompt content.

Frequently asked questions

How accurate is this Claude token calculator?

It is an estimate. The counter uses a characters÷4 heuristic (with an optional denser-tokenizer uplift for newer Claude models). Real billed tokens depend on the provider tokenizer, tools, images, and cache. Treat results as planning numbers, not invoices.

Does this count toward Claude Code usage limits?

No. This page estimates API pay-as-you-go cost in dollars. Claude Code on a Pro or Max subscription is gated by a 5-hour window and weekly cap, not by this dollar math. See our Claude Code usage limits guide for those clocks.

Is my pasted text uploaded anywhere?

No. The counter and cost math run entirely in your browser with inline JavaScript. There are no network calls to score your text — nothing is sent to Hypermile or a third party.

Where do the model prices come from?

Prices are baked in at build time from provider documentation as of August 2026. Providers change rates; always verify against Anthropic and OpenAI pricing pages before budgeting production spend.

Did Claude Sonnet 5 API prices increase on 1 September 2026?

No. As of 28 August 2026, Anthropic’s pricing documentation says the $2/$10 per million input/output rates for Claude Sonnet 5 are now the standard price, and the increase to $3/$15 that had been scheduled for 1 September 2026 will not occur. Re-check Anthropic’s page before you lock a production budget — list prices can still change later.