Token counter · cost calculator
LLM Token Cost Calculator
Paste any prompt and see its token count and USD cost across GPT-5.6 (Sol / Terra / Luna), Claude Fable 5, Opus 4.8, Sonnet 5, Haiku 4.5 and Gemini 3 side by side — with editable prices and a monthly cost estimate for your call volume. Everything runs in your browser; your text is never uploaded.
✦ From the guides shelf: Full July 2026 pricing table + 3 real workload costs →
Cost of 0 input tokens + 500 output tokens, one call, across every model. Edit any price to match today's rate.
| Model | Input $/1M | Output $/1M | Input cost | Output cost | Total / call |
|---|
Monthly cost at scale
Same prompt, repeated at your call volume — see the spread before you pick a model for production.
| Model | Cost / call | Calls / month | Monthly cost |
|---|
How it works
What this calculator does
This tool estimates how many tokens a piece of text will use, then multiplies that estimate by the published per-token price of eleven current models — GPT-5.6 Sol / Terra / Luna, GPT-4.1 nano, Claude Fable 5, Claude Opus 4.8, Claude Sonnet 5, Claude Haiku 4.5, and Gemini 3.5 Flash / 3.1 Pro / 3 Flash — so you can see the same prompt's cost across providers in one table instead of opening three pricing pages and doing the math by hand. The differentiator over a plain token counter: it also projects a monthly cost from your expected call volume, which is the number that actually shows up on an invoice.
Every price field in the comparison table is editable. Providers change list prices without much warning, so rather than hard-coding numbers that go stale, this tool ships with the published list price per model as of 2026-07-11 and lets you overwrite any cell with the exact rate from today's pricing page — the whole table and the monthly projection recalculate instantly, with no page reload.
Paste your prompt
Drop in a real prompt, system message, or a document chunk you plan to send as context.
Set expected output length
Tell it roughly how many tokens the model's reply will be — output is priced higher than input.
Compare per-call cost
Read the side-by-side table; the cheapest model for this exact prompt is highlighted.
Project the monthly bill
Enter your daily call volume to see what that prompt costs per model, per month, at scale.
Worked examples
Input → output
Input: "Classify the sentiment of this review as positive, negative, or neutral: 'The battery life is incredible but the camera is disappointing in low light.'" (151 characters, 24 words → click "Short prompt" above to load it) Input tokens (est.) = 38 Output tokens (est.) = 62 (a one-word label plus a short reason) Cost at default prices, 1 call: GPT-4.1 nano → $0.000029 (cheapest) Gemini 3 Flash → $0.000205 Claude Haiku → $0.000348 GPT-5.6 Luna → $0.000410 Claude Sonnet 5 → $0.000696 Claude Opus 4.8 → $0.001740 Claude Fable 5 → $0.003480
Input: a refund-policy paragraph pasted as retrieval context, followed by a customer question (796 characters, 123 words → click "RAG context block" above to load it) Input tokens (est.) = 199 Output tokens (est.) = 500 (an explanatory paragraph answer) At 1,000 calls/day, 30 days/month: GPT-4.1 nano → $6.60/mo (cheapest) Gemini 3 Flash → $47.99/mo Claude Haiku → $80.97/mo GPT-5.6 Luna → $95.97/mo Claude Sonnet 5 → $161.94/mo Claude Opus 4.8 → $404.85/mo Claude Fable 5 → $809.70/mo
Why token math matters
Reading the numbers
Token count is not the same as word count or character count. English prose averages roughly 4 characters per token or 0.75 tokens per word, but code, JSON, URLs, and non-English text tokenize differently — a JSON blob with lots of punctuation and short keys can use noticeably more tokens per character than a paragraph of plain English. That is why this calculator blends a character-based and a word-based estimate rather than a single fixed ratio.
Cost math has two halves that people often forget to separate: input tokens (what you send — your prompt, system message, and any retrieved context) and output tokens (what the model generates back), priced at a different, usually higher, rate per provider. A short prompt that triggers a long, detailed answer can cost more than a long prompt that gets a one-word reply — which is exactly the trap this side-by-side table is built to make visible before it shows up as a surprise on a bill.
- Prompt caching / batch discounts — several providers discount repeated context (cached input) by up to 90% and offer roughly 50% off for async batch jobs; this calculator shows standard synchronous pricing, so your real bill may be lower if you use those features.
- Context length tiers — some models charge more once a request crosses a context-length threshold (e.g. above 128K or 200K tokens); the defaults here reflect the standard, lower tier.
- Mini/flash models exist for a reason — GPT-4.1 nano, GPT-5.6 Luna, Claude Haiku 4.5 and Gemini 3 Flash are commonly 10-50x cheaper per token than their flagship siblings for tasks like classification, extraction, or simple chat.
FAQ
Common questions
How accurate is the token count?+
It is an approximation, not an exact tokenizer. The calculator blends a character-based estimate (roughly 1 token per 4 characters of English text) with a word-based estimate (roughly 1.3 tokens per word) and takes the higher of the two, which tracks real tokenizers like OpenAI's tiktoken and Anthropic's tokenizer within a few percent for normal prose. Code, non-English text, and strings with lots of punctuation or numbers tokenize less predictably, so treat the number as a planning estimate, not a billing-exact count.
Why do input and output tokens cost different amounts?+
Every major provider — OpenAI, Anthropic, Google — prices output tokens higher than input tokens, usually 3 to 5 times higher, because generating text is more compute-intensive than reading it. That is why this calculator asks for expected output length separately: a short prompt that produces a long answer can cost more than a long prompt that produces a one-line answer.
Are the default prices up to date?+
The defaults are seeded from published list prices as of July 11, 2026 and are labeled with the model snapshot they represent. Providers change prices without much notice, so every price field is editable — paste in the current per-million-token rate from OpenAI, Anthropic, or Google's pricing page and the whole comparison recalculates instantly.
Does this send my prompt to any API?+
No. There is no network request anywhere in this page. Token counting and cost math run in plain JavaScript in your browser tab. You can open this page, turn off your Wi-Fi, and it keeps working — nothing you paste is ever transmitted, logged, or stored.
How do I estimate my monthly LLM API bill?+
Paste a representative prompt (or your system prompt plus a typical user message), set the expected output length, then enter how many calls you make per day in the monthly section. The tool multiplies the per-call cost of your prompt by your daily volume and by the number of days per month to project a monthly cost for every model at once, so you can see the spread before you pick a model for production.
What is the difference between GPT-4.1 nano, Claude Haiku and Gemini 3 Flash?+
These are each provider's small, fast, cheap tier, built for high-volume tasks like classification, extraction, or simple chat where the flagship model's extra reasoning is not needed. They typically cost a fraction of the flagship price per token. This calculator lets you compare a mini/small model against a flagship model on the exact same prompt so you can see whether the savings are worth the quality trade-off for your use case.