Claude Token Cost Calculator

Model prices are illustrative reference points and change over time — verify current rates at anthropic.com/pricing, or choose "Custom Rate" to enter your own.

Input and Output Tokens Aren't Priced the Same

Anthropic, like every major LLM provider, charges a different rate for tokens you send in (the prompt, context, and any retrieved documents) versus tokens the model generates back. Output tokens typically cost several times more per token than input tokens, which means a task that produces a long response — a written draft, a long code file — can cost more than its input size alone would suggest. This calculator applies each rate to its own token count separately, then adds the two together.

The Formula

Input Cost = (Input Tokens ÷ 1,000,000) × Price per 1M Input Tokens
Output Cost = (Output Tokens ÷ 1,000,000) × Price per 1M Output Tokens
Total Cost = Input Cost + Output Cost

Prices are quoted per million tokens, which is the standard unit LLM providers use for API pricing, so token counts are first divided by 1,000,000 before being multiplied by the per-model rate.

Where This Calculation Matters

  • Estimating a single API call's cost — before running a call at scale, checking what one request with a known input and expected output length will cost.
  • Comparing Claude models — a smaller, faster model can cost a fraction of a flagship model per token; running the same token counts through each helps decide whether the quality difference justifies the price gap for a given task.
  • Batch and pipeline budgeting — multiplying a per-call cost by expected call volume to project a daily or monthly API bill before deploying an application at scale.
  • Prompt cost tuning — since input and output are priced independently, this calculator makes it clear whether trimming prompt length or capping output length would save more on a specific workload.

Why the Model Selector Matters

The calculator includes a dropdown of current Claude model families (Opus, Sonnet, and Haiku tiers) with built-in per-model rates, plus a "Custom Rate" option for entering your own input/output prices per million tokens directly.

Note: Anthropic's published API pricing changes over time and differs across model generations and tiers. The rates built into this calculator are reference points, not a live feed — always confirm current pricing at anthropic.com/pricing before budgeting a production workload, or use the Custom Rate option with a rate you've verified yourself.

How to Use This Calculator

  1. Select a Model from the dropdown, or choose "Custom Rate" to enter your own pricing.
  2. If using Custom Rate, enter the Custom Input Price and Custom Output Price per 1M tokens.
  3. Enter the Input Tokens count for your request.
  4. Enter the Output Tokens count for the expected or actual response.
  5. Select Calculate for the total estimated cost, broken down by input and output.

Related Calculations

Need a token count before pricing it out? Start with the AI Token Calculator, or compare against other providers with the OpenAI Token Cost Calculator and the Gemini Token Cost Calculator.