Introduction
AI models charge you by the token. A token is a small piece of text, about 4 characters long.1 Every prompt you send and every answer you get back costs money. This Token Cost Calculator shows you that cost before you get the bill.
Paste your text, type a word count, or enter exact token numbers. Then pick how many API calls you plan to make. The tool works out your input cost, output cost, and cached token cost for over 40 models from OpenAI, Anthropic, Google Gemini, xAI Grok, DeepSeek, Perplexity, and Mistral. If you only need the token counts themselves without pricing, the Token Calculator handles that job.
You can compare models side by side, see a chart of where your money goes, and switch to euros, pounds, yen, or Canadian dollars. Every price box can be edited, so you can test your own rates or a deal you were offered. The step-by-step section shows the math, so you can check the numbers yourself.
Use it to plan a budget, pick a cheaper model, or find out if prompt caching is worth it for your app.
How to use our Token Cost Calculator
Tell the calculator how much text you send to an AI model and how many times you send it. It shows your token counts, the cost per API call, the total cost for all calls, a side-by-side model comparison, and a chart of where the money goes.
Text Input tab: Paste or type your real prompt here. The tool counts the characters and words and turns them into an estimated token count.
Word Count tab: Type one number if you already know the size of your prompt. Then pick Words, Tokens, or Characters so the tool knows how to read that number.
Token Count tab: Enter exact token numbers from your API logs. Fill in input tokens, cached prompt tokens (tokens read from the provider's cache), and output tokens.
Output size slider: Set how long the model's answer is, as a percent of your input tokens. Use the quick buttons like Chat 75% or Classification 10% if you are not sure.
Number of API calls: Enter how many times you will run this prompt. The cost per call is multiplied by this number.
Cached share of input (%): Enter what part of your prompt is reused and served from cache. Cached tokens cost less on models that offer a cache rate.
Anthropic cache-write tier: Pick None if your cache is already warm. Pick the 5-minute or 1-hour tier to add the one-time cache write fee to Claude models.
Display currency: Choose USD, EUR, GBP, JPY, or CAD. All prices are set in USD and converted at a rough rate.
Provider filter: Click a provider name to show or hide its models. Hover the info icon to see how that provider bills caching.
Search box: Type part of a model or provider name, like "haiku" or "gemini", to shrink the table fast.
Sort menu: Keep the default grouped view, or sort every model from cheapest to most expensive by total cost.
Compare checkboxes: Tick the models you want to test. Pick two or more to unlock the comparison table and the stacked chart.
Rate boxes: Change any input, output, cached, or fixed-fee price if your contract rate is different. Edited boxes turn amber and have a reset button.
Show only selected rows: Turn this on to hide every model you did not tick.
Buttons: Press Calculate to refresh the numbers, Highlight Best Value to mark the cheapest pick, Copy Estimate to save the breakdown as text, and Reset to start over.
What Are AI Tokens?
A token is a small piece of text. Most AI models break your words into these pieces before they read them. One token is about 4 characters, or roughly three-quarters of a word.1 So 100 words is about 133 tokens. Short words may be one token. Long or odd words may be split into two or three.
How AI Token Pricing Works
AI companies charge by the token, not by the question. Prices are listed in dollars per 1 million tokens. Every API call has two main parts:
- Input tokens: the text you send in, like your prompt, chat history, and any documents you paste.
- Output tokens: the text the model writes back.
Output almost always costs more than input. On Claude Sonnet 5.5, for example, output costs $10 per million tokens and input costs $2.2 That is because the model has to think and build each new word, which takes more computer power than reading.
Cached Tokens Can Cut Your Bill
If you send the same starting text again and again, like a long system prompt, the provider can save it. This is called prompt caching. Reading from the cache is much cheaper. On most Claude models, a cache read costs 10% of the standard input price.2 Anthropic also charges a write premium to store the text: 1.25 times the base input price for a 5-minute cache, or 2 times for a 1-hour cache.2 Google bills cached tokens at a reduced rate plus a storage price for each hour the cache is kept.3 OpenAI's GPT-6 models also list a separate cache-write rate.4 Perplexity's Sonar models have no cache discount, so every input token costs full price.
Other Things That Change the Price
- Context tiers: Some models charge more when your prompt goes over a set size. Gemini Pro models switch to a higher rate for prompts over 200K tokens.3 OpenAI's GPT-6 models switch to a higher rate above 272K input tokens.4
- Time of day: DeepSeek's off-peak rates are half of its peak rates, and peak hours are 01:00 to 04:00 and 06:00 to 10:00 UTC, Monday through Friday.5
- Fixed fees: Perplexity's Sonar models add a flat search fee to every request, on top of the token cost.
- Promo prices: A few models have temporary low rates that end on a set date. Gemini 3.8 Flash, for example, is $0.75 per million input tokens through December 31, 2026, and $1.50 starting January 1, 2027.3
Why Estimating Token Costs Matters
One API call may cost less than a penny. But apps make thousands or millions of calls. Small price gaps grow fast. A model at $15 per million output tokens costs 30 times more than one at $0.50. Checking the math before you build helps you pick the right model, set a real budget, and avoid a surprise bill.
If AI calls are part of a product you sell, token spend belongs in your unit economics.
Simple Ways to Spend Less
- Ask for shorter answers. Set a word or token limit in your prompt.
- Use a small model for easy jobs like sorting or tagging. Save big models for hard work.
- Put your fixed instructions at the start so caching can pick them up.
- Trim old chat history and cut extra documents you do not need.
- Batch jobs when you can. Anthropic's Batch API, for example, gives a 50% discount on both input and output tokens.2
Note: Token counts here are estimates based on 1 token ≈ 4 characters. Each model uses its own tokenizer, so real counts will be a little different. Always check the provider's current price page before you commit to a budget.