LLM Token Cost Calculator

Large language model APIs bill by tokens, usually quoted per million tokens, with separate prices for the input prompt and the generated output. This calculator multiplies your token counts by the prices you enter and scales by the number of calls to estimate total spend. Because per-token prices vary by provider and change over time, you supply them yourself from your provider's official pricing page, so nothing here is guessed.

0.00
0.00
0.00
0.00

Token cost formula

Input cost per call = input tokens / 1,000,000 * input price
Output cost per call = output tokens / 1,000,000 * output price
Cost per call = input cost + output cost
Total cost = cost per call * number of calls

Prices are quoted per million tokens by most providers. Dividing the token count by 1,000,000 converts it to "millions of tokens" before multiplying by the price.

Worked example

Suppose 1,000 input tokens and 500 output tokens per call, an input price of US$3.00 and output price of US$15.00 per million tokens, over 1,000 calls. Input cost per call = 1,000 / 1,000,000 times 3 = US$0.003. Output cost per call = 500 / 1,000,000 times 15 = US$0.0075. Cost per call = US$0.0105. Total over 1,000 calls = US$10.50.

LLM token cost: frequently asked questions

How is LLM API cost calculated?

Most providers price by tokens, quoted per million tokens, and charge input (prompt) tokens and output (completion) tokens at separate rates. Cost equals (input tokens divided by 1,000,000 times input price) plus (output tokens divided by 1,000,000 times output price), multiplied by the number of calls.

Why does this calculator ask me to enter the prices?

Per-token prices differ by provider and model and change over time. Rather than hardcode a figure that could be wrong, this tool takes the input and output prices as editable fields. Enter the current published prices from your provider's official pricing page for an accurate estimate.

What is a token?

A token is a chunk of text the model processes, often a word fragment. As a rough guide many English texts run near 4 characters or about three-quarters of a word per token, but the exact count depends on the model's tokenizer. Use your provider's tokenizer for precise counts.

Does this include caching or batch discounts?

No. This is a straightforward input-plus-output estimate. Discounts such as prompt caching or batch processing, where offered, reduce the effective price; to model them, enter your discounted effective per-million-token rate in the price fields.

Sources and notes

  • The cost formula is simple arithmetic on token counts and the per-million-token prices you supply.
  • Enter current prices from your provider's official pricing page. This tool does not store or assert any provider's prices.

Reviewed by the CalculatorHub team, edited by James Graham, 19 June 2026. See our methodology.