Claude Sonnet 4.6 Token Counter

Exact token count and cost for Claude Sonnet 4.6, worked out in your browser.

0 characters0 words
Tokens~97% accurate
0
Estimated cost
Input
$0.00
$3/1M tokens
Output
$0.00
$15/1M tokens
Context window0 / 200,000
0.00% used

The same tokeniser, a different bill

Sonnet 4.6 shares its vocabulary with every other Claude model, so the token count here is identical to what Opus or Haiku would report for the same text. Only the price changes. That makes this page useful mostly as a cost comparison rather than a different measurement.

The count is exact. Anthropic's tokeniser runs locally in the page, so the number matches what the API bills, unlike the models here that have to be estimated with a stand-in encoding.

Where it sits on price

$3 per million input and $15 per million output. That is 60 percent of Opus in both directions, with the same 5 to 1 output-to-input ratio.

For the workloads most people actually run, the quality difference does not justify the gap. Extraction, classification, summarisation, routing, formatting, straightforward code edits: Sonnet handles all of it. Opus pulls ahead on long multi-step reasoning and genuinely hard problems, and paying for that on a task that does not need it is the most common way to overspend.

Haiku at $1 and $5 is the next step down and worth testing if your task is mechanical.

More detail

Budgeting a real workload

Take a representative prompt, count it here, then estimate the reply length. A 20,000-token input with a 2,000-token response is 6 cents plus 3 cents, so 9 cents a call. At a thousand calls a day that is $90 daily, and the input half of it is the part prompt caching can collapse.

The output half cannot be cached. If your bill is dominated by output, the lever is asking for less, not sending less.

What is not counted here

System prompt, tool definitions, per-message framing and images. Tool schemas in particular are billed on every turn, so an agent with a dozen tools carries thousands of input tokens before your message is even considered.

Questions

Will the count differ if I switch to Opus?

No. All Claude models share one tokeniser, so the count is the same for identical text. Switching changes the cost calculation and nothing else.

When is Opus worth the extra money?

Long multi-step reasoning, hard debugging, and tasks where a wrong answer is expensive. For extraction, classification, summarisation and routine code work, Sonnet is usually indistinguishable at 60 percent of the price.

Is my text sent anywhere to be counted?

No. The vocabulary is bundled into the page and the encoding happens in your browser, so nothing leaves the tab.

How do I cut a bill that is mostly output?

Cap the maximum output length, request structured data rather than prose, and tell the model not to restate your input. Prompt caching helps the input side only, so it does nothing for an output-heavy workload.

Related tools