Skip to main content
tokenmath
Menu

By tokenmath Research Desk · Pricing verified 2026-07-06

Claude 5 Sonnet token & cost calculator

Claude 5 Sonnet is the current-generation workhorse — the model most production workloads should default to before reaching for Opus. It brings two changes that matter for budgeting: a 1,000,000-token context window (5× the 200K on Sonnet 4.5) and Anthropic's newer tokenizer, which counts about 30% more tokens for the same text. It's launching at an introductory $2 input / $10 output per million through August 31, 2026, then moves to standard $3/$15 on September 1.

The net effect today: Sonnet 5 is both newer and cheaper than Sonnet 4.5 — but the higher token count from the new tokenizer offsets part of the lower rate, so price a real prompt rather than assuming the intro discount flows straight through. After the intro window, the decision between 4.5 and 5 comes down to context window and quality, not price.

Client-side. Never uploaded.
0 / 1,000,000 charactersContext window: 1,000,000 tokens
Or start with an example
Total estimated cost
$0.010Claude 5 Sonnet
Tokens±2% approx
0
Input cost
$0.00
Output cost (est.)
$0.010
@ 1,024 response tokens
Context used
0%
of 1,000,000
Verified 2026-07-06 · ±2%
Saved scenariosnone yet

Saved on this browser only — never uploaded. Up to 10 scenarios.

Tip: save a scenario when you have a prompt + model + response length you might revisit. Useful for sizing features before committing to a vendor.

Verify privacysince this page loaded — updates live
Prompt uploads0Always 0 — by design
Outgoing requests0Analytics + page assets only — no prompt content
Cookies on this origin0Vercel Analytics + Clarity may set first-party cookies
localStorage keys0Theme preference + saved scenarios live here
Server endpoints1/api/og only — accepts title + subtitle, never prompt text
Inspect

Open DevTools → Network. Type into the calculator. No request bodies should contain your prompt text.

Pricing

Sonnet 5 is flat-priced — no tier surcharge across its million-token context. Today's rate is the introductory $2/$10 per million; on September 1, 2026 it becomes $3/$15. The dataAsOf date on this page tracks when we last reconciled against Anthropic's published rate.

TierInput $/MOutput $/M
All input$2$10
Context window1,000,000 tokens

Verified against platform.claude.com on 2026-07-06.

Worked examples

Costs at the current introductory $2/$10 rate, from a short turn up to a large single-call input its million-token window now allows. Paste your own prompt above to price it exactly — and remember the September 1 move to $3/$15 raises each of these by half.

ScenarioInputOutputCost
Short chat turn
A typical Q&A turn with a small system prompt.
800400<$0.01
RAG answer
Retrieved context plus a grounded, structured response.
12,000800$0.032
Long-document Q&A
A large input that wouldn't have fit in Sonnet 4.5's 200K window.
200,0002,000$0.420
Near-full context
Close to the million-token ceiling in a single request.
900,0004,000$1.84

The input/output ratio is where Sonnet budgets are won or lost: at $2 input vs. $10 output (and $3 vs. $15 after September), a chat product whose typical turn is 800 input + 400 output spends most of its money on generated tokens. Clamp max_tokens, and cache stable prefixes — cached reads run at roughly a tenth of the input rate.

How is this counted?

Sonnet 5 uses Anthropic's newer tokenizer, which produces roughly 30% more tokens than the previous Claude encoding on the same text. Anthropic doesn't publish a client-side tokenizer, so we approximate: count with cl100k_base (gpt-tokenizer, MIT), then apply a ~1.3× calibration to track the newer tokenizer. That makes Sonnet 5 estimates rougher than for Sonnet 4.5 — budget ±10%, not ±2% — so treat the number as a planning figure and reconcile against the API response headers. Inputs over 50,000 characters run in a Web Worker.

FAQ

Why is Claude 5 Sonnet cheaper than Claude 4.5 Sonnet right now?
Introductory pricing. Sonnet 5 launched at a promotional $2 input / $10 output per million, in effect through August 31, 2026. On September 1, 2026 it moves to standard pricing of $3/$15 — the same rate as Sonnet 4.5. So today Sonnet 5 is both newer and cheaper; after the intro window it matches 4.5 on price while keeping the larger context window.
How is Claude 5 Sonnet different from Claude 4.5 Sonnet?
Two things that matter for cost planning: Sonnet 5 has a 1,000,000-token context window (5× the 200,000 on Sonnet 4.5), and it uses Anthropic's newer tokenizer, which packs about 30% more tokens into the same text. So a prompt that fit in 4.5 will report a higher token count — and cost — on Sonnet 5, even before the September price change.
How accurate is the token count?
Sonnet 5 uses Anthropic's newer tokenizer (~30% more tokens than the previous encoding on the same text). We approximate it by applying a ~1.3× calibration to the cl100k_base count. That's a solid planning estimate, but the multiplier varies with content, so treat the count as roughly ±10% rather than the ±2% we quote for older Claude models. Reconcile against the API response headers for billing.
What is the context window?
1,000,000 tokens — the full million-token window, matching Opus 4.8 and 5× what Sonnet 4.5 offered. The calculator warns you when input alone would exceed it.
When should I still reach for Opus?
Sonnet 5 is the default for production workloads. Move up to Opus 4.8 only for the slice of genuinely hard requests where a lift in reasoning quality pays for the roughly 2.5× price step; move down to Haiku 4.5 for cheap, high-volume classification. Route by difficulty.

Compare against every other model

To see this exact prompt scored against every supported model, sorted by total cost, paste it into the home calculator and toggle Compare across all models. Numbers are exact for OpenAI and approximate for Claude and Gemini — within ±2–3% for most, wider for the newer-tokenizer Claude models (Sonnet 5, Opus 4.7/4.8).

The natural comparison set: Claude 4.5 Sonnet (the prior-generation Sonnet, 200K context, standard $3/$15), Claude 4.8 Opus (the flagship, when the task needs stronger reasoning), and Claude 4.5 Haiku (the budget tier for high-volume, latency-sensitive work).

Keyboard shortcuts

Press ? any time to reopen this list.

Show this overlay?
Toggle themet
Focus the prompt textarea/
Go to homegh
Go to modelsgm
Go to pricing datagp
Go to changeloggc
Go to aboutga
Close overlays / dialogsEsc

We use Vercel Web Analytics for aggregate page metrics and (optionally) Microsoft Clarity for masked session replay. Prompt content is never sent. Read the privacy policy.