AI Prompt Cost Calculator
Estimate the API cost of an LLM call from input and output tokens, per-million prices you enter, and the number of requests.
About the AI Prompt Cost Calculator
The AI Prompt Cost Calculator turns the raw numbers behind an LLM API call into a clear dollar figure. You tell it how many input tokens your prompt uses, how many output tokens you expect back, the price your provider charges per million input and output tokens, and how many times you plan to run the call. It instantly works out the cost of a single request and the total across every request, so you can budget a feature, compare models, or sanity-check a bill before you commit to a workload.
Because model prices change frequently, this tool never ships with hard-coded rates that quietly go stale. Instead, you paste in the current per-million prices straight from your provider's pricing page, which means the numbers you see are always based on today's rates rather than whatever was true when the tool was built. Everything runs entirely in your browser — no tokens, prompts, or prices are ever sent anywhere, there is no sign-up, and once the page has loaded the calculator keeps working even without an internet connection. Empty, negative, or invalid entries simply show a friendly prompt instead of a confusing "NaN", so you always get a sensible answer or a clear nudge to fix an input.
How to use
- Enter your input tokens — the size of the prompt you send, including any system message, context, and examples.
- Enter your output tokens — how many tokens you expect the model to generate in its reply.
- Copy the current prices for input and output from your provider's pricing page and paste them into the two price fields (both are quoted in USD per one million tokens).
- Set the number of requests you plan to make — leave it at 1 for a single call, or raise it to estimate a batch or a whole month of traffic.
- Read the result below: the cost per request is shown to four decimal places, and the total across all requests is shown to two decimal places.
How the math works
The cost of one request is calculated as (inputTokens × inputPrice + outputTokens × outputPrice) ÷ 1,000,000, because prices are quoted per million tokens. The total is simply that per-request cost multiplied by the number of requests. Splitting input and output pricing matters because most providers charge more for generated (output) tokens than for prompt (input) tokens, so a chatty response can cost far more than a long prompt.
Frequently asked questions
Where do I find the price per million tokens?
Open your provider's official pricing page and look for the model you are using. Prices are usually listed as a dollar amount per one million (1M) input tokens and a separate amount per one million output tokens. Copy those two figures directly into the price fields. Entering them yourself keeps this calculator accurate even as prices change.
Why are input and output priced separately?
Providers almost always charge a different rate for the tokens you send (input) than for the tokens the model generates (output), and output is typically more expensive. Keeping them separate lets you see the true cost of a call, especially when a short prompt produces a long answer or vice versa.
How do I estimate the token counts?
As a rough guide, one token is about four characters or three-quarters of a word in English, but the exact count depends on the model's tokenizer. For a closer figure, use a dedicated token counter on your actual prompt and expected response, then plug those numbers in here.
What happens if I leave a field blank or type a negative number?
Nothing breaks. The calculator only produces a result when every field holds a valid, non-negative value and the request count is a whole number of at least one. Otherwise it shows a short prompt asking you to complete the inputs, so you will never see a misleading cost.
Is my data private, and does this work offline?
Yes on both counts. Every calculation happens locally in your browser — no tokens, prompts, or prices are uploaded, stored, or tracked. After the page loads once, the calculator continues to work with no internet connection at all.