Skip to content
Calixo

Claude Token Calculator

Calculate the exact cost of a Claude API call from separate input and output token counts and per-model pricing — covers Claude Opus, Sonnet and Haiku rates, including a 1-million-token benchmark.

Inputs

Default is Claude Sonnet 4's published input rate — change to match your model.

Default is Claude Sonnet 4's published output rate — change to match your model.

Paste this into any page — the widget stays live and updates automatically as this calculator improves. Using WordPress or Notion? See the embed guide.

Saved Scenarios

— select 2+ to compare
Inputs updated · Results recalculated · Just now

Total Cost

$9.0000

Input Cost

$1.5000

Output Cost

$7.5000

Spark says

How it's calculated
Detailed view of a computer processor. Ideal for technology themes.
Photo by Pixabay on Pexels
A female engineer using a laptop while monitoring data servers in a modern server room.
Photo by Christina Morillo on Pexels

Formula

Cost=InputTokens106×InputRate+OutputTokens106×OutputRateCost = \dfrac{InputTokens}{10^6}\times InputRate + \dfrac{OutputTokens}{10^6}\times OutputRate
InputRate
— Price per 1 million input tokens for the specific Claude model
OutputRate
— Price per 1 million output tokens for the specific Claude model

What is the Claude Token Calculator?

This calculator computes the exact cost of a Claude API call by applying separate input and output token pricing — the same two-rate structure Anthropic actually bills on — rather than a single blended rate, and directly answers 'what does the Claude API cost for 1 million tokens' for any model tier.

Use this when estimating what a specific Claude Opus, Sonnet or Haiku request will cost before running it at scale, comparing cost across Claude model tiers for the same task, or directly answering 'what would 1 million tokens cost on Claude' for a specific model.

How to use it

  1. 1 Enter your input token count (your prompt, system message, and any conversation history) and output token count (Claude's response) separately.
  2. 2 Enter the input and output price per 1 million tokens for your specific Claude model from Anthropic's pricing page.
  3. 3 Read the total cost, plus the input and output cost breakdown.

Understanding Claude Token Calculator

Anthropic structures Claude's model lineup around a clear capability-versus-cost tradeoff, and — much like other major LLM providers — prices output tokens meaningfully higher than input tokens across every tier, which is exactly why separating the two rates, as this calculator does, matters for an accurate cost picture rather than relying on a single blended per-token number.

Claude Opus sits at the top of the lineup, priced for the most demanding reasoning, analysis, and complex agentic tasks, and its per-token rate reflects that positioning — commonly several times higher than the mid-tier Sonnet model at both the input and output rate. Sonnet occupies a genuinely popular middle ground: strong general-purpose capability at a meaningfully lower price point than Opus, which is why it's frequently the default choice for production applications that need solid reasoning without paying flagship-tier prices for every request. Haiku sits at the lightweight end, priced for high-volume, latency-sensitive, or simpler tasks — classification, short-form extraction, quick formatting — where Opus or even Sonnet's additional capability wouldn't meaningfully improve the result.

A detail genuinely worth understanding for anyone running a Claude-based workload at real volume is prompt caching, a feature that isn't unique to Claude but that Anthropic has built directly into its API pricing structure. When a request repeatedly sends the same large block of context — a long system prompt, a reference document, a codebase excerpt used across many separate requests — prompt caching lets that repeated portion be billed at a substantially discounted rate on subsequent requests (roughly a fraction of the standard input rate) rather than paying full input price to reprocess identical context every single time. For workloads genuinely built around a large, mostly-static context reused across many requests — a common pattern for retrieval-augmented generation or document-analysis tools — prompt caching can meaningfully change the real-world economics of a workload well below what a naive per-token calculation (like this calculator's base estimate) would suggest, which is exactly why it's worth checking Anthropic's caching-specific pricing directly for any workload with genuinely repeated context.

On the specific, commonly searched question of 'what does the Claude API cost for 1 million tokens' — the honest answer is that it depends entirely on which model tier and how that million splits between input and output, which is exactly why a single headline number doesn't actually answer the question usefully. A million tokens weighted toward input (say, analyzing a large document with a short summary output) costs meaningfully less than the same million weighted toward output (say, generating a long report from a short prompt), and the model tier chosen changes the answer by a full order of magnitude between Haiku and Opus. This calculator's split input/output fields, pre-filled to Sonnet 4's published rates as a reasonable middle-tier benchmark, are built specifically to give a genuinely accurate answer for your actual expected token split and model choice, rather than a single misleading average.

As with any LLM provider, the practical path to controlling Claude API cost at scale mirrors the broader industry pattern: default to the lightest tier that reliably handles a given task, reserve the heavier tiers for requests that genuinely need the extra capability, actively use prompt caching for any workload with meaningfully repeated context, and separately estimate expected output length (not just input length) since output's higher per-token rate means response length disproportionately drives total cost for any given task.

Worked examples

Advantages

  • Models input and output tokens at their real, separate published rates instead of one averaged number.
  • Covers every current Claude model tier by simply changing the two price fields.
  • Shows the input/output cost split, making it clear which side of a request actually drives the bill.
  • Defaults are pre-filled to directly answer a 1-million-token cost benchmark for Claude Sonnet 4.

Limitations

  • Pricing fields default to a snapshot of Claude Sonnet 4's published rates and don't update automatically — always confirm current pricing on Anthropic's official pricing page before budgeting. Doesn't model prompt caching discounts, which can meaningfully reduce cost for repeated context.

Common mistakes

  • ⚠️ Using one blended token rate instead of Claude's actual separate input and output rates, which understates cost for any task with a meaningfully long generated response.
  • ⚠️ Not accounting for Claude's prompt caching feature, which offers a substantially discounted rate for repeated, unchanged context (like a long system prompt reused across many requests) — a workload with heavy repeated context can cost meaningfully less in practice than this calculator's non-cached estimate.
  • ⚠️ Comparing Claude tiers on sticker price per token alone without accounting for how reliably each tier handles your specific task — a cheaper tier that needs retries to get an acceptable result can end up costing more in practice than a pricier tier that succeeds on the first attempt.

Tips

  • 💡 What does the Claude API cost for 1 million tokens? At Sonnet 4's rate, a 1-million-token request split evenly between input and output costs about $9.00; the same volume on Opus 4 costs about $45.00, and on a lighter Haiku-tier model considerably less — always check Anthropic's current pricing page for exact figures.
  • 💡 Model system prompts and retrieved context (for RAG applications) as part of your input token count, since they're billed identically to user-entered text.
  • 💡 Check whether prompt caching applies to your workload if you repeatedly send the same large context (like a long system prompt or reference document) — it can substantially reduce effective input cost versus this calculator's non-cached figure.
  • 💡 Test whether a lighter Claude tier handles your specific task adequately before defaulting to the flagship Opus tier — the cost difference between tiers is substantial.

Real-life uses

  • Estimating what a specific Claude Opus, Sonnet or Haiku request will cost before running it at scale
  • Comparing cost across Claude model tiers for the same task
  • Directly answering 'what would 1 million tokens cost on Claude' for a specific model
  • Budgeting an AI feature built on the Claude API before writing production code

Frequently asked questions

What does the Claude API cost for 1 million tokens?

At Sonnet 4's rate, a 1-million-token request split evenly between input and output costs about $9.00; the same volume on Opus 4 costs about $45.00, and on a lighter Haiku-tier model considerably less — always check Anthropic's current pricing page for exact figures.

Where do I find current Claude pricing?

Anthropic's official pricing page lists current per-model input and output rates per 1 million tokens — always check there before finalizing a budget, since rates change over time.

Does this calculator account for prompt caching?

No — it models standard, non-cached pricing. Prompt caching offers a substantially discounted rate for repeated, unchanged context and can meaningfully reduce real-world cost below this calculator's base estimate for workloads with heavily repeated context.

How much cheaper is Sonnet than Opus?

Opus is commonly priced several times higher than Sonnet at both the input and output rate — in the examples on this page, an identical token volume costs 5x more on Opus 4 than on Sonnet 4.

Should I always use Claude Opus for the best results?

Not necessarily — Sonnet and Haiku tiers handle many tasks reliably at a meaningfully lower cost; reserve Opus for genuinely demanding reasoning or analysis tasks where the extra capability actually improves the result.