hackerdb

Home / Free tools / LLM token and cost estimator

LLM token and monthly cost estimator for agents and prompts

Paste a prompt, or enter token counts, add your model's price per million tokens, and see cost per run, per day and per month. It models cached input and context that grows over a multi-step run, which is where agent bills actually come from.

How to use it

  1. Estimate or enter tokens. Paste the prompt to get a rough count, or type the input and output token counts from your provider's usage logs.
  2. Describe the run. How many model calls per run and how much context each step adds to later steps.
  3. Enter your prices. Copy your model's current prices per million tokens; the defaults are placeholders.
  4. Read per-run, per-day and per-month cost. Then change one input at a time to see which lever matters.

Why agent costs surprise people

A chat message is one call. An agent run is many: each step sends the instructions, the history and the tool results so far, then adds more. Because every later step re-sends everything before it, input tokens grow roughly with the square of the number of steps unless something trims the history. A twelve-step run that adds 1,500 tokens per step sends about 100,000 or more input tokens in total, even though no single message looks large. The estimator makes that visible with the context-growth field.

Levers that actually reduce cost

About the token estimate

The character-based estimate (about four characters per token for English prose) is a rule of thumb. Code, numbers and non-English text usually produce more tokens per character, and each model family tokenizes differently. For decisions that matter, take real counts from your provider's usage data.

Worked example

This is what the tool produces for the sample input, so you can see the result without running it.

Input

You are a support assistant for an online shop. Answer using only the knowledge base excerpts below. If you are unsure, say so and offer to escalate. Keep answers under 120 words.

Result

Pasted text: 179 characters, 32 words, roughly 40 to 51 tokens for English (about 4 characters per token; code and other languages run higher).

MeasureValue
Input tokens, first call45
Total input tokens per run (all calls)4,980
Total output tokens per run1,200
Cost per run$0.0249
Cost per day (500 runs)$12.44
Cost per month (30 days)$373

Frequently asked questions

How accurate is the token estimate?

Within roughly 20 to 30 percent for English prose. Code and other languages usually use more tokens per character. Use your provider's usage logs for exact figures.

Does it know current model prices?

No. You enter the prices, so it never goes out of date and never claims a price it cannot know.

What is context growth?

Tokens added by each step (tool output, replies) that are re-sent to every later step in the same run.

Is my text uploaded?

No. Everything is calculated in your browser.

More free tools

All free tools