apprun.icuCalculator

Calculator · AI & APIs

Count tokens. Know the API cost before you ship.

Paste a prompt and watch it counted into tokens as you type, then priced — input and output, per request and at scale — across 32 large language models from OpenAI, Anthropic, Google, xAI, DeepSeek, Mistral, Qwen and Meta. Nothing is sent anywhere.

Free no accountPrivate runs in your browser32 models 8 providersExport copy, CSV, share link

Count & price your prompt

Everything updates as you type. Prices checked 17 October 2026 — see the full pricing table and how the counts work.

Processed on your device. Your text is never uploaded, saved, or put in a share link.

Or paste a sample reply to estimate output tokens

Your text, counted

Estimated input tokens
—
Likely range
—
Characters
—
Words
—
Output tokens used
—
Cheapest model here
—

Token counts are estimates (±~12% on English prose). See method & limits.

Selected model

Input cost / request
—
Output cost / request
—
Total / request
—
Total for all requests
—

Context window fit

Token chunks (first 60, colour = estimated split)

—

All 32 models, live

ModelProviderEst. tokensInput / reqOutput / reqTotal / reqAll requestsContextFits?

How to use this calculator

  1. Paste or type your prompt. The counter updates as you type: characters, words and estimated tokens, with a likely range for the tokenizer family you choose.
  2. Set the expected reply length. Drag the output slider, type an output token count, or paste a sample reply and let the counter estimate it the same way.
  3. Set how many requests you will make. One request is a rounding error; a million is a budget line. The multiplier shows both per-request and total cost.
  4. Compare 32 models. Sort the live table by input, output or total cost, filter by provider, and pin a model to check its context-window fit.
  5. Copy, export or share. Copy a plain-text summary, download the comparison as CSV, or share a link that carries your settings — never your text.

Worked example: 1,000 tokens in, 500 tokens out

Same request, six models. Per-request cost is a fraction of a cent everywhere — the last two columns are why model choice matters.

ModelProviderPer request1,000 requests1,000,000 requests
Claude Haiku 5.5Anthropic$0.0003$0.35$350
GPT-5 miniOpenAI$0.0013$1.25$1,250
Gemini 2.5 FlashGoogle$0.0015$1.55$1,550
Claude Sonnet 5.5Anthropic$0.0070$7.00$7,000
GPT-5.5OpenAI$0.0200$20.00$20,000
Claude Fable 5.1Anthropic$0.0350$35.00$35,000

The formula behind every figure on this page: cost = input tokens ÷ 1,000,000 × input price + output tokens ÷ 1,000,000 × output price. Multiply by your request count for a daily or monthly figure. For a bill you can defend, feed in the real token counts from an API response’s usage object — providers report exact input and output tokens on every call.

LLM API pricing table — all 32 models

Standard first-party API list prices, USD per 1 million tokens, checked 17 October 2026 against provider pricing pages. Cached-input, batch, long-context and reasoning-token charges are excluded — see method & limits. Always confirm on the provider’s page before budgeting.

ModelProviderInput / 1MOutput / 1MContext
GPT-5.5
Flagship. Long-context surcharge above 272K tokens not modelled.
OpenAI$5.00$30.001M
GPT-5.4OpenAI$2.50$15.001M
GPT-5OpenAI$1.25$10.00400K
GPT-5 miniOpenAI$0.25$2.00400K
GPT-5 nanoOpenAI$0.05$0.4400K
GPT-4.1OpenAI$2.00$8.001M
GPT-4.1 miniOpenAI$0.4$1.601M
GPT-4.1 nanoOpenAI$0.1$0.41M
GPT-4oOpenAI$2.50$10.00128K
GPT-4o miniOpenAI$0.15$0.6128K
Claude Fable 5.1
Most capable Claude tier.
Anthropic$10.00$50.001M
Claude Opus 5.5Anthropic$4.00$20.001M
Claude Sonnet 5.5Anthropic$2.00$10.001M
Claude Sonnet 4.6
Previous Sonnet generation.
Anthropic$3.00$15.001M
Claude Haiku 5.5
Rate shown for prompts up to 100K tokens; higher above that.
Anthropic$0.1$0.5200K
Claude Haiku 4.5Anthropic$1.00$5.00200K
Gemini 3.1 Pro
Rate shown up to 200K-token prompts; higher above that.
Google$2.00$12.001M
Gemini 2.5 Pro
Rate shown up to 200K-token prompts; higher above that.
Google$1.25$10.001M
Gemini 2.5 FlashGoogle$0.3$2.501M
Gemini 3.1 Flash-LiteGoogle$0.25$1.501M
Gemini 2.5 Flash-LiteGoogle$0.1$0.41M
Grok 4.3xAI$1.25$2.501M
Grok 4.1 FastxAI$0.2$0.52M
DeepSeek V4 ProDeepSeek$0.435$0.871M
DeepSeek V4 FlashDeepSeek$0.14$0.281M
DeepSeek Chat (V3)DeepSeek$0.27$1.10128K
Mistral MediumMistral$1.50$7.50256K
Mistral SmallMistral$0.2$0.6128K
Ministral 3BMistral$0.1$0.1256K
Qwen3 Max
Model Studio list rate; region and host rates vary.
Alibaba Qwen$1.25$3.75256K
Qwen Turbo
Model Studio list rate; region and host rates vary.
Alibaba Qwen$0.05$0.21M
Llama 4 Maverick (hosted)
Open weights: typical hosted rate, varies by host. Self-hosting bills compute, not tokens.
Meta Llama$0.15$0.61M

Sources

How the numbers work — method & limits

How tokens are estimated

Real tokenizers (byte-pair encoding) need a vocabulary of 100,000+ merge rules per model family, which no honest in-browser estimator can ship for four families at once. Instead, this counter first splits your text into the same pre-chunks those tokenizers use — words with their leading space, digit groups of up to three, punctuation runs, whitespace — then estimates how many sub-word tokens each chunk becomes, counting CJK characters individually and emoji as multi-byte symbols. A per-family factor then adjusts for each tokenizer’s typical density: OpenAI-style as the baseline, Claude and Gemini slightly leaner on prose, Llama-style slightly heavier. Each row in the live table also re-estimates with that model’s own family factor, so the comparison reflects tokenizer differences, not just prices.

How accurate is it?

On ordinary English prose, expect the estimate within roughly 10–15% of a provider’s count; the counter prints that range (0.88×–1.12×) beside every result. Code, JSON, URLs, long numbers, repeated characters and non-English text can stray further. Use this page to compare models and size a budget; use the provider’s tokenizer or the usage counts in a real API response when a cent matters.

What is not modelled

  • Prompt caching (typically 50–90% off repeated input) and batch APIs (typically 50% off, asynchronous).
  • Reasoning (“thinking”) tokens, which providers bill as output even though you never see them.
  • Long-context surcharges and tiers (for example higher Gemini Pro and GPT-5.5 rates on very long prompts); the base-tier rate is used and the table says where a tier exists.
  • Chat overhead: message role wrappers, tool definitions and image/audio tokens add tokens a raw text paste does not show.
  • Taxes, committed-use and negotiated discounts.

Cutting the bill, in the order that usually pays

  1. Shorten what repeats: the system prompt and conversation history are re-billed every turn, so trimming 200 tokens there beats trimming 200 anywhere else. Our Word Counter helps draft tighter text.
  2. Cap the reply: set a maximum output length, and remember output is the expensive side.
  3. Route by difficulty: send easy traffic to a mini/Flash/Haiku-class model and keep the flagship for the hard tail.
  4. Cache stable prefixes and batch anything that can wait.
  5. Measure, don’t guess: log the usage object from real responses, then compare models on your own traffic shape with the calculator above.

Questions

What is a token in an LLM?

A token is a chunk of text a model reads or writes at one step — roughly 4 characters or 0.75 words of ordinary English. “Tokenization” is usually 2 tokens, a rare surname can be 3 or 4, and numbers split into groups of up to 3 digits. Providers bill input (your prompt, system message and history) and output (the reply) separately, per million tokens.

How accurate is this token counter?

It is an estimator, not a provider tokenizer. It splits your text the way byte-pair tokenizers do, then estimates sub-words per chunk, with a per-family adjustment for OpenAI, Claude, Gemini and Llama-style tokenizers. Expect it to land within roughly 10–15% of a provider count on English prose; code, JSON, URLs and non-English text vary more. The counter shows that likely range next to every count. For a bill-exact number, run the provider’s own tokenizer (for example tiktoken for OpenAI models) or read the usage object in an API response.

How is the cost of an LLM request calculated?

Cost = (input tokens ÷ 1,000,000 × input price) + (output tokens ÷ 1,000,000 × output price). A 1,000-token prompt with a 500-token reply on a model priced at $2 input and $10 output per million costs 1,000 ÷ 1,000,000 × $2 + 500 ÷ 1,000,000 × $10 = $0.002 + $0.005 = $0.007 per request. Multiply by requests per day or month before you judge whether a model is “cheap”.

Why are output tokens more expensive than input tokens?

Input tokens are processed in parallel in one pass; output tokens are generated one at a time, each requiring a full pass over the model. That serial work is why output typically costs 2× to 8× the input rate, and why a long reply to a short prompt can cost more than the prompt did.

Do different models count the same text as the same number of tokens?

No. Each model family ships its own tokenizer, so the same paragraph can differ by 5–20% between families, and far more in languages the tokenizer was not optimised for. That is why this page lets you switch tokenizer family, and why a model with a higher price per token but a leaner tokenizer can occasionally win on real text.

What about cached prompts and batch discounts?

They are real but excluded here so the comparison stays on one basis. Prompt caching typically discounts repeated input by 50–90%, and batch APIs typically halve both rates in exchange for slower, asynchronous answers. Reasoning models also bill hidden thinking tokens as output. Check each provider’s pricing page before budgeting a production workload.

Does my text leave my browser?

No. Counting, cost maths, CSV export and share links all run locally in this tab. Nothing is uploaded, and the share link carries only your settings (model, output length and request count) — never your text. Closing the tab discards everything.

How do I reduce my LLM API bill?

Shorten the system prompt and trim chat history, because both are re-billed on every turn. Set a maximum output length. Route easy requests to a small model and reserve the flagship for hard ones. Cache repeated prompt prefixes, use the batch API for work that can wait, and measure real token usage from API responses instead of guessing from character counts.