Claude Code cost calculator: work out your bill from token counts
One formula, the November 2026 list prices for Opus 5.5, Sonnet 5.5 and Haiku 5.5, a worked example, and where to get real token counts.
By ClaudeGPT Si Newsroom, Editorial team
3 min read
A Claude Code cost calculator is four multiplications and a sum: input, output, cache write and cache read tokens, each times the model's price per million tokens. Run it on a week of your own logs and you know whether a $20, $100 or $200 plan beats paying per token, or the other way round.
No web form can do this for you, because the hard part is the token counts, not the arithmetic. This guide gives you the formula, the prices to plug in, a worked example and the quickest way to get real numbers.
The formula
cost = (input × input price
+ output × output price
+ cache writes × cache write price
+ cache reads × cache read price) / 1,000,000
Prices are quoted per million tokens (MTok), hence the division. Run it once per model, then add the results.
Prices to plug in
List prices from Anthropic's pricing page, checked November 3, 2026, per million tokens:
| Model | Input | Output | Cache write | Cache read |
|---|---|---|---|---|
| Opus 5.5 | $4 | $20 | $5 | $0.20 |
| Sonnet 5.5 | $2 | $10 | $2.50 | $0.10 |
| Haiku 5.5, prompts up to 100K tokens | $0.10 | $0.50 | $0.125 | $0.01 |
Two shortcuts. Opus 5.5 is exactly double Sonnet 5.5 on every column. And the cache prices assume the five-minute cache lifetime. Longer caching has its own prices.
A worked example
Take a made-up day on Sonnet 5.5. The counts are invented for the arithmetic, so swap in your own.
- 300,000 input tokens: 0.3 × $2 = $0.60
- 80,000 output tokens: 0.08 × $10 = $0.80
- 1,200,000 cache write tokens: 1.2 × $2.50 = $3.00
- 25,000,000 cache read tokens: 25 × $0.10 = $2.50
That day costs $6.90 at list price, or $13.80 if the same tokens ran on Opus 5.5. Twenty such working days come to $138 on Sonnet and $276 on Opus. Set that against Pro at $20, Max at $100 and Ultra at $200 a month, and a plan wins clearly, provided its usage limits let you get through the month.
Notice where the money went. The cache lines cost more than the fresh input and output combined. Claude Code sends the whole conversation with every request, and caching turns most of that resend into cache reads, so long sessions grow the biggest number in your log. Clearing context between unrelated tasks shrinks it.
Where to get the token counts
Inside Claude Code, the Session block of /usage lists input, output, cache read and cache write tokens per model for the current session, with a dollar total. It resets when /clear starts a new session, so it covers one sitting, not a month.
For a month, UsageAtlas does the whole calculation for you. It is a free, open-source desktop app for Windows, macOS and Linux that reads Claude Code's local logs, splits input, output and cache tokens, and estimates cost per model at list prices, by day and by project. It also keeps history after Claude Code clears its local files at the 30-day default, so a full month is there when you want to compare plans. No account is needed, and it does not read your prompts or responses.
What the formula leaves out
- Fast mode on Opus 5.5 costs twice the standard price.
- US-only inference adds 10% to input and output prices.
- Tax is extra, and negotiated enterprise rates differ from list price.
- On a Pro, Max or Ultra plan you do not pay this figure at all. It is a comparison number.
Every calculator, Claude Code's own included, gives an estimate. Anthropic's invoice or the Console's cost page is the actual bill.
When you can skip the math
If you are on Pro and rarely hit a limit, the calculation only confirms you are on the cheapest plan. It earns its keep when you are choosing between an API key and a plan, or wondering whether Max would pay off.