Skip to content

Claude Code cost calculator ​

Enter recorded tokens to estimate their API-equivalent cost in USD. This free Claude token cost calculator separates normal input, output, cache reads and both cache-write lifetimes. No installation, account or API key required.

Enable JavaScript to use the calculator. The formula and reviewed rates remain readable below.

No upload, API key or installation. Tool input stays in this page’s memory; reset or reload clears it. Normal documentation asset requests still occur.

Recorded tokens
Rates · USD per million tokens

Preset rates checked: 2026-10-06 · Official pricing

Monthly scenario

Not a bill or a prediction of Pro/Max capacity. Excludes provider modifiers and non-token charges. Monthly cost assumes the same usage repeats; a daily total should use one summary per day.

Where to find Claude Code token usage ​

The Session block in Claude Code’s /usage reports token usage and an estimated cost. Some versions also expose /cost; command availability and fields depend on your version. Enter per-model token counts, not the subscription percentage bars. For saved history, use the local JSONL token counter.

Do not enter a combined “input including cache” number as base input. Anthropic’s input_tokens excludes cache_read_input_tokens and cache_creation_input_tokens. Split cache writes into 5-minute and 1-hour counts; if your source only gives a combined write count, its lifetime is unknown. Verify it rather than counting the combined total in both fields.

Formula and worked example ​

All five token categories are disjoint. Rates are USD per million tokens (MTok):

text
cost = (base input × input rate
      + output × output rate
      + cache reads × cache-read rate
      + 5m cache writes × 5m-write rate
      + 1h cache writes × 1h-write rate) / 1,000,000
working-month cost = cost × summaries per day × working days

The public example uses Sonnet 5.5: 10,000 base-input tokens ($0.02), 5,000 output ($0.05), 300,000 cache reads ($0.06), 10,000 five-minute writes ($0.025) and no one-hour writes. Total: $0.155. Four identical summaries per day over 22 working days produce a hypothetical $13.64 per month. A daily aggregate should use one summary per day, not multiply its sessions again.

Intermediate calculations are not rounded; displayed costs use up to six decimal places. A positive result below $0.000001 is labeled as below that amount, not zero. This is a repeat-usage scenario, not a forecast of changing task sizes.

Model rates and cache pricing ​

Rates checked on 2026-10-06 against Anthropic’s official pricing. These are selected standard global API list prices, not every available model or a live price feed.

Rates · USD per million tokens
Model / pricing presetBase input (excluding cache)OutputCache read5-minute cache write1-hour cache write
Claude Sonnet 5.52100.22.54
Claude Sonnet 52100.22.54
Claude Opus 5.54200.258
Claude Opus 4.85250.56.2510
Claude Opus 4.65250.56.2510
Claude Sonnet 4.63150.33.756
Claude Haiku 4.5150.11.252

Cache-read rates are model-specific: Opus 5.5 uses $0.20/MTok while Opus 4.8 uses $0.50/MTok. Do not apply a universal 0.1× rule. If a model is absent, choose custom rates and verify all five prices yourself; we never silently substitute an unrelated model.

Fast mode, batch discounts, geography/data-residency premiums, cloud-provider prices, negotiated discounts, taxes and tool charges are outside these presets. Multi-model work requires separate calculations per model and summing their costs; the same token count does not predict equal task quality across models.

Is this my Claude Pro or Max bill? ​

No. API-equivalent token cost is not your subscription fee, remaining quota, reset time or number of prompts left. Use the actual provider’s usage report and invoice for financial reconciliation. Claude Code’s own estimate may use an organization’s configured rates, so matching list-price arithmetic need not match it.

See the official Claude Code cost guide and the subscription/quota distinction.

Compare historical projects, not just one estimate ​

The web calculator evaluates one entered summary. Sessions Viewer statistics compare recorded usage by project, model and time; the Claude Code history guide shows reading, search and resume.

Download Sessions Viewer for desktop history and analytics, or count a saved JSONL locally in your browser. See privacy and data handling. No token input is uploaded, saved in the URL or sent to a model.