Claude Code Cost Calculator

Drop your session log — get instant cost breakdown by model, tool & hour

Claude Code
Runs in your browser — zero data sent
All Claude models + accurate cache pricing
Drag & drop .jsonl files or paste text
Or estimate cost with sliders — no log needed
Current Claude API Pricing (May 2026) ▾
Model Input ($/M) Output ($/M) Cache Write ($/M) Cache Read ($/M)
Opus 4.7$15.00$75.00$18.75$1.50
Sonnet 4.6$3.00$15.00$3.75$0.30
Haiku 4.5$0.80$4.00$1.00$0.08
3.7 Sonnet$3.00$15.00$3.75$0.30
3.5 Haiku$0.80$4.00$1.00$0.08
3 Opus$15.00$75.00$18.75$1.50
3 Haiku$0.25$1.25$0.30$0.03

Prices sourced from Anthropic docs. Cache reads save ~90% vs full input. Drop your session log below to calculate your exact spend.

Your Claude Code session log (.jsonl)

Claude Code stores session logs as JSONL files (one JSON object per line).

Find them at:

~/.claude/projects/<project-slug>/<session-id>.jsonl

On macOS/Linux, list recent sessions:

ls -lt ~/.claude/projects/**/*.jsonl | head -5

Then drag the .jsonl file onto the drop zone below, or cat it and paste. Your data never leaves your browser.

📂
Drop your .jsonl file here
or click to browse
or paste JSONL text below
By Model
Model Tokens Cost Share
Cache Savings
Model Reads Saved

By Tool Use
Tool Calls % of Turns
Cost by Hour

Estimated cost

Per session (today)
Per week
Per month (4 weeks)
Cache read savings (est.)
Token throughput
Estimates assume typical Claude Code usage patterns based on real session benchmarks. Cache read rate: 70–80% of input tokens after warm-up. Actual costs vary by prompt length and caching. Analyze your actual session log for exact numbers.

Frequently Asked Questions

How much does Claude Code cost per session?

It depends on the models you use and how many tokens are in your context. A typical 60-minute coding session with Claude Sonnet 4.6 and heavy context (files, tool outputs) might cost $0.50–$3.00. Larger refactoring sessions with Opus can run $5–$20. Drop your session log above to get your exact number — it takes under a second.

Where do I find my Claude Code session log?

Claude Code stores session logs as JSONL files at:

~/.claude/projects/<project-slug>/<session-id>.jsonl

On macOS/Linux, run ls -lt ~/.claude/projects/**/*.jsonl | head -5 to list your five most recent sessions. Then drag the file directly onto the drop zone above — your data never leaves your browser.

What is prompt caching and how much does it save?

Claude Code uses Anthropic's prompt caching feature: repeated context (system prompt, large files already read) is written to a cache once, then subsequent reads cost only 10% of the normal input price. For long sessions with lots of file context, this easily saves 60–80% of what you'd otherwise spend. The calculator shows your exact savings in the "Cache Savings" breakdown.

Which Claude models does Claude Code use?

By default Claude Code uses claude-sonnet-4-6 for most tasks. You can switch to claude-opus-4-7 for harder reasoning (at 5× the price) or claude-haiku-4-5 for fast, cheap sub-tasks. The calculator handles all models and their exact per-token prices — if your log contains multiple models, costs are broken out per model.

How does this calculator work? Is my data safe?

Everything runs entirely in your browser using JavaScript — no server receives your log data. The page parses each JSONL line, extracts the usage fields (input_tokens, output_tokens, cache_creation_input_tokens, cache_read_input_tokens) and multiplies by Anthropic's published per-million-token rates. The source is straightforward to audit in your browser's DevTools.

How do I reduce my Claude Code costs?

Use /compact frequently — this condenses long conversations so less stale context is re-sent each turn. Use Haiku for simple tasks — Haiku 4.5 costs 75% less than Sonnet. Keep files targeted — large files read into context multiply every subsequent turn's input cost. Close sessions — leaving a session idle with a large context wastes cache write tokens. Most developers find their bill drops 40–60% after adopting these habits.

Can I calculate costs for the Anthropic API (not Claude Code)?

Yes — if your API responses include a usage object with input_tokens and output_tokens, paste them as JSONL and the calculator will price them correctly. The pricing table uses the same rates for both Claude Code and direct API usage, since Claude Code is billed through the standard API.

Visual references

Claude API cost over time
Line chart 2023→2026, per-million tokens by tier.
Token budget cheat sheet
Context windows, cache math, payload sizes.

FAQ

How much does Claude Code cost per day?
It depends on which model you use and how much prompt caching kicks in. Paste your session log into the calculator above to see the exact breakdown, including cache_read savings.
What is cache_read pricing and how does it save money?
cache_read tokens are billed at 10% of the input-token rate (90% off). Long Claude Code sessions reuse the same system prompt and recent turns, so most of the context window after the first few messages is served from cache.
Does this tool send my session data anywhere?
No. All parsing and cost math runs locally in your browser. Your session log never leaves your device. The page only loads a 1x1 visitor-count beacon and the Vercel analytics script.