Free browser tool
LLM Token Cost Calculator
LLM token cost calculator using measured or provider-reported input and output tokens with rates you enter.
LLM token cost calculator: estimate charges from measured token counts rather than an approximate text-length conversion.
Supply token counts for the actual model
Use measured or provider-reported token counts. This tool deliberately does not turn characters into an allegedly exact token count: different tokenisers, languages and structured prompts can behave differently. Input tokens include prompt and relevant conversation context; output counts should include billable categories reported by the provider.
All rates and costs must use the same currency. Example amounts are fictional assumptions. No vendor rates are preselected and no API calls are made.
Worked example
For 12,000 input and 3,000 output tokens at illustrative rates of 1 and 4 per million, the cost is 0.024 in the same currency as the rates. At a user-entered batch ratio of 0.5, it is 0.012. No model-specific rate is assumed.
Assumptions and limits
Collect token usage from a representative test set, including longer inputs and tool results. Compare median and high-percentile requests separately. This calculator reports the entered counts; it does not validate model context limits or send text to an API.
Pricing references checked 6 October 2026
Use the linked official provider pricing pages for the model and service you actually select. Rates vary by model, processing mode, cache operations and service. Copy the applicable rates into your assumptions and retain the source and date. This calculator’s illustrative rates are not a model price table.
Who should use this calculator and how to read it
This calculator is for teams that already have token counts from a provider response, representative test, or other trusted measurement. Enter input and output counts and the applicable rates per million. If the provider reports cached input, enter that subset and its rate; the tool keeps cached and uncached input charges separate. All rates and outputs must use the same currency.
It deliberately does not convert arbitrary text into an exact token count. Tokenization varies by model, language, formatting, and conversation context. For an end-to-end agent workload, use the agent cost calculator; for a scenario with separate cache and batch assumptions, use the LLM API calculator; for costs against time saved, use the ROI calculator.
Frequently asked questions
Can I paste text to get an exact token count?
No. This tool takes counts; it does not tokenize text or contact a model API. Get counts from the target model or provider, including the relevant conversation context and billable output categories.
Which input count should I enter?
Use the billable input count for the request, including system instructions, relevant prior context, and tool results when they are counted as input. Avoid counting cached tokens again outside the total input amount.
Can one rate represent every model?
No. Enter rates for the selected model, service, and processing mode, using the right currency and billing unit. Rates and eligibility can differ for input, output, cached tokens, and batch work.
What does the result leave out?
It does not validate context limits, fetch current prices, or model tools, hosting, retries, support, and other invoice items. Add separately billed categories to a wider cost record and retain the source and date for each rate.
Use measured counts for a token estimate
A token cost calculator should start with the counts reported by the selected model or a representative test. An AI token calculator cannot infer an exact count from arbitrary text because tokenization varies with model, language, formatting and context. Keep cached tokens separate when the provider reports a distinct billable category, and use rates in the same currency.
The fictional sample uses 12,000 input tokens at $1 per million and 3,000 output tokens at $4 per million: $0.012 + $0.012 = $0.024. With an entered batch ratio of 0.5, the result is $0.012, but only if your provider and workload actually qualify for that rate. The calculator reports the supplied counts and assumptions; it does not send prompts or verify an invoice.
Updated 2026-10-08. Sources are linked on this page.
Primary sources and review
- OpenAI: official API pricing and cost units
- Anthropic: official pricing, caching and batch rates
- NIST AI RMF: risk-management work to account for in operating costs
Published by AI Agent Cost Calculator. Last updated: . Methods on this site are practical workflows; outputs do not certify compliance.