LLM token and cost estimator

A token is the unit of text a large language model reads and writes; in English one token is roughly four characters or three-quarters of a word.

Estimate prompt and output tokens at about 4 characters per token and project monthly LLM API cost in USD from your own rates. Runs in your browser.

Browser-sideNo accountCopy, download, or print

Token counts are estimates at about 4 characters per token. Rates are USD per million tokens that you enter; check your provider's current pricing before approving a budget.

Last reviewed

Your inputs are saved as a draft in this browser only. Nothing is uploaded.

Jump to result
Interactive workspace

Inputs

Shown in the summary; the estimate uses the rates you enter.

Result

More export options

Input tokens/request41
Output tokens/request24
Monthly requests3,000
Monthly cost (USD)$1.45
Context use65 / 1,28,000

Token counts are estimated at about 4 characters per token; real tokenizers differ by model and language.

Model set: GPT + Claude + Llama comparison
Input tokens/request: 41
Output tokens/request: 24
Context use: 65 of 1,28,000 tokens (0.05%)
Estimated monthly requests: 3,000
Cost per request: $0.000483
Estimated monthly cost: $1.45 (USD, at the per-million-token rates you entered)
Optimization notes:
- Cache repeated system prompts and shared context where your provider supports prompt caching.
- Cap output length and ask for structured output to reduce output tokens, which usually cost more per token.
- Trim examples and history that do not change the answer.

Examples

Characters to tokens

A 400-character prompt is estimated at 100 tokens (400 ÷ 4). The sample prompt in the tool has 163 characters, so it is estimated at 41 tokens.

Cost of one request

1,000 input tokens and 500 output tokens at $3 and $15 per million tokens cost 1,000 × 3 ÷ 1,000,000 + 500 × 15 ÷ 1,000,000 = $0.003 + $0.0075 = $0.0105.

Monthly cost

That request repeated 100 times a day for 30 days is 3,000 requests, or 3,000 × $0.0105 = $31.50 a month.

Trim the output

Output tokens are often priced higher than input. Cutting the expected output from 500 to 250 tokens at $15 per million saves $0.00375 a request, or $11.25 a month at 3,000 requests.

Add a margin for code and other scripts

Code, numbers, and non-Latin scripts usually produce more tokens per character than English prose, so add a margin, or measure a sample with your provider's tokenizer.

How to use it

  1. Paste your prompt text and an example of the output you expect.
  2. Set daily requests and days per month to size your monthly usage.
  3. Enter your provider's input and output rates in USD per million tokens.
  4. Review the token estimates and the monthly cost in USD, then copy the summary.

Questions

How does it count tokens?
It estimates from text length at roughly four characters per token, a common rule of thumb for English. Each model uses its own tokenizer, so treat the counts as planning estimates.
What currency are the costs in?
US dollars. LLM API providers usually quote prices in USD per million tokens, so enter your rates that way and read the result in USD.
Are the default rates current provider pricing?
No. The input and output rates are editable planning assumptions. Check your provider's current price list before approving a budget.
Why are input and output tokens priced differently?
Generating output takes more compute per token than reading input, so providers usually charge more for output. Long answers can cost more than long prompts.
How many words is 1,000 tokens?
Roughly 750 English words, using the common approximation of 0.75 words per token. The ratio is lower for code and many non-English languages.
What is a context window?
The maximum number of tokens a model can handle in one request, counting the prompt, any retrieved context, and the output. If prompt plus expected output approaches the limit, shorten the context or split the task.
Is my prompt text uploaded for counting?
No. The estimation runs entirely in your browser and nothing is uploaded.