HCODX/Claude Cost Calculator
100% browser-based · Opus · Sonnet · Haiku

Claude Cost Calculator

Estimate Claude API costs across the full Anthropic family — Opus 4.7, Sonnet 4.6, and Haiku 4.5. Pick a single model or compare all three side-by-side.

Prompt text0 tokens
Cost breakdown
Calculator options
3,000calls / month · ~100 / day
Count tokens precisely
Input tokens
0
Output tokens
0
Per call
Status
Ready
Pricing reference

Anthropic pricing reference (per 1M tokens)

Source: Anthropic pricing page. Cached input enjoys a 90% discount.

ModelInput / 1MOutput / 1MContext
Claude Opus 4.7
Anthropic
$15.00$75.00200K
Claude Sonnet 4.6
Anthropic
$3.00$15.00200K
Claude Haiku 4.5
Anthropic
$1.00$5.00200K
Use cases

What you'll use this for

LLM costs scale fast. A quick estimate before you ship saves real money in production.

Budget planning

Project monthly and annual API spend before you ship. Catch surprises before billing does.

Comparing models

Pick the right model for your use case. Cheapest that passes your evals usually wins.

Cost optimization

Estimate caching impact, identify the cheapest viable model, find the breakeven for a smaller tier.

Pricing transparency

Show stakeholders concrete numbers for "what does AI cost us?" — no vendor pitch deck required.

Step by step

How to estimate LLM cost

1

Paste a representative prompt

Use something real from your app, not a toy example. Token count scales with input length.

2

Set expected output tokens

How long is the model's reply? 500 tokens is a typical chat response; classification might be 5; agents can run thousands.

3

Set calls per day

Conservative is fine. Multiply by users × actions/user/day. The yearly figure is usually the eye-opener.

4

Read totals

Per call, per day, per month, per year. Toggle caching to see the discount impact.

FAQ

Frequently asked questions

This calculator uses a rough heuristic of ~4 characters per token. Real tokenizers vary: code is denser, languages other than English are sparser, and each provider has its own tokenizer. Expect ±20% accuracy. For exact counts use the model-specific token counters.

From each provider's public pricing page as of 2026. Rates are subject to change; always verify on the provider site before relying on these numbers for procurement decisions.

Yes. No signup, no limits, no ads, no data leaves your browser.

Toggle "Input is cached" for an approximate 90% input-side discount. The exact discount varies by provider (Anthropic: 90%; OpenAI/Google: 50-75%). This calculator uses the Anthropic figure as a useful upper bound.

A few reasons. (1) Token counts on the provider may differ slightly from our ~4-char estimate. (2) System prompts, tool definitions, and retrieved context all count toward input. (3) Provider rates may have changed since this tool was last updated. (4) Some providers add surcharges for premium tiers, regional endpoints, or long-context overflow. Use this for ballpark estimates, not for final accounting.

About

About Claude pricing

Anthropic prices Claude per million tokens with a clean tier structure: Opus is the flagship at $15 / $75 per 1M (input / output), Sonnet sits in the middle at $3 / $15, and Haiku is the small fast model at $1 / $5. Output is always 5× the input rate — a deliberate signal that long replies cost real money.

Picking the right Claude

Opus for hard reasoning, long autonomous agentic loops, code generation. Sonnet for most chat / RAG / coding assistant use cases — it's the workhorse. Haiku for high-volume classification, summarization, simple tool use where latency and price dominate.

Prompt caching

Anthropic's prompt caching gives a 90% discount on cached input tokens. Cache writes cost 25% more than uncached input on first write, then 10% on reads. For repeated system prompts (long instructions, large RAG context), enable caching — the math usually works out after 2-3 reuses.

Related

Related tools