Skip to content
CalculatorAtlas

Token Cost Calculator

Tested

Language-model cost from token counts and prices you enter.

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

$
$

Results

Enter your values and press Calculate. Results appear here.

  • • Result

Quick answer

Cost = tokens ÷ 1,000,000 × price, summed for input and output. 120,000 input tokens at $3 per million and 30,000 output tokens at $15 per million cost $0.36 + $0.45 = $0.81.

Enter input and output tokens and their prices per million. The calculator returns the total and each part.

Related tools: API Request Cost Calculator: API cost from request volume and a price per million. Cloud Storage Cost Calculator: Storage cost from size and a price you enter. Fuel Cost Calculator: Trip fuel cost from distance, fuel economy and price.

How to use the Token Cost Calculator

  1. Enter input tokens (0 or more).
  2. Enter output tokens (0 or more).
  3. Enter input price per million tokens ($) (0 or more).
  4. Enter output price per million tokens ($) (0 or more).
  5. Press Calculate to see the result, and use Reset to start again.
Inputs of the Token Cost Calculator
InputWhat to enterAllowed values
Input tokensA number≥ 0
Output tokensA number≥ 0
Input price per million tokensA number, in $≥ 0
Output price per million tokensA number, in $≥ 0

Formula and method

Formula

cost = tokens ÷ 1,000,000 × price, summed for input and output

IEEE-754 double precision; shown to the decimals indicated.

Prices change often, so enter the current ones from your provider; caching and batch discounts are not applied.

Worked examples

These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.

Example 1

Inputs: Input tokens = 120000; Output tokens = 30000; Input price per million tokens = 3; Output price per million tokens = 15.

Results of example 1
ResultValue
Total cost$0.81
Input cost$0.36
Output cost$0.45

Example 2

Inputs: Input tokens = 5000000; Output tokens = 800000; Input price per million tokens = 0.25; Output price per million tokens = 1.25.

Results of example 2
ResultValue
Total cost$2.25
Input cost$1.25
Output cost$1.00

The first line is the headline result (total cost). Below it the token Cost Calculator lists input cost and output cost, which describe the same case from other angles. IEEE-754 double precision; shown to the decimals indicated.

Output costs more

Here output is 20% of the tokens but 56% of the cost. Cutting verbose responses saves more than trimming prompts.

Not included

Discounts such as caching or batch pricing are not applied, so enter the effective price you pay. Prices change, so use your provider's current price list.

How the result changes with input tokens

Holding every other input at the first worked example, this table changes only input tokens. It shows how sensitive the answer is to that one value; each row was produced by running this calculator.

How the result changes with input tokens
Input tokensTotal costInput costOutput cost
60000$0.63$0.18$0.45
120000$0.81$0.36$0.45
240000$1.17$0.72$0.45
480000$1.89$1.44$0.45

What happens with invalid input

These messages are produced by the calculator itself, so you know what to fix.

  • Input tokens: entering "-1" shows "Input tokens must be at least 0." beside that field and no result.
  • Input price per million tokens: left empty shows "Enter input price per million tokens." beside that field and no result.

Choosing between the Token Cost Calculator and similar calculators

Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.

Choosing between the Token Cost Calculator and similar calculators
CalculatorYou enterIt returns
[API Request Cost Calculator](/technology/api-request-cost-calculator/)requests and price per million requestsCost
[Cloud Storage Cost Calculator](/technology/cloud-storage-cost-calculator/)data stored, price per GB per month and monthsTotal cost
[Fuel Cost Calculator](/automotive/fuel-cost-calculator/)distance, fuel economy and fuel priceTrip cost
[Marginal Cost Calculator](/business/marginal-cost/)total cost before, total cost after and quantity beforeMarginal cost
[Opportunity Cost Calculator](/business/opportunity-cost/)return of the option you gave up and return of the option you choseOpportunity cost

Background: networking and display

Network speeds are quoted in bits per second and file sizes in bytes, and a byte is 8 bits, so a 100 Mbps link moves at most 12.5 megabytes per second; real throughput is usually below the advertised rate. Pixel density is the diagonal in pixels divided by the diagonal in inches: a 1920×1080 display of 24 inches is about 92 pixels per inch, and a 3840×2160 display of 27 inches about 163.

Assumptions and limitations

  • Discounts are not applied

If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for input tokens and input price per million tokens to confirm this.

Frequently asked questions

What is a token?

A chunk of text, roughly three-quarters of a word.

How do I estimate monthly cost?

Multiply per-request cost by volume.

Do prices differ by model?

Yes. Prices per million tokens differ by model and by input versus output, so enter the rates for the model you use.

What does the Token Cost Calculator calculate?

Language-model cost from token counts and prices you enter. It returns Total cost, Input cost and Output cost.

What formula does the Token Cost Calculator use?

cost = tokens ÷ 1,000,000 × price, summed for input and output. Prices change often, so enter the current ones from your provider; caching and batch discounts are not applied.

What do I need to enter in the token Cost Calculator?

You enter Input tokens, Output tokens, Input price per million tokens ($) and Output price per million tokens ($).

How is the result rounded or limited?

IEEE-754 double precision; shown to the decimals indicated. Discounts are not applied.

What is an example of a token Cost result?

With input tokens 120000, output tokens 30000, input price per million tokens 3 and output price per million tokens 15, the total cost is $0.81.

Where does the method come from?

The method follows: Your model provider's published price list.

Sources

  • Your model provider's published price list

Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.