Prompt Diff with Token Count

At $2.00 per million input tokens (GPT-4.1, prices checked 2026-10-15), trimming 1,000 tokens from a prompt saves $2.00 over 1,000 calls. Cost = tokens ÷ 1,000,000 × price × calls. Paste two prompt versions to see your own difference.

Input prices from the LLM API Cost Calculator, checked on 2026-10-15

Did this solve your problem?
Prefer us on Google

How to use

  1. Paste the old prompt in Version A and the new one in Version B.
  2. Pick the model you call. Its input price and tokenizer decide the token counts and the cost.
  3. Read the token and cost difference, and see removed words in red and added words in green in the diff. Set the number of calls to see the effect at your volume.

How it works

The diff splits both prompts into words, spaces and punctuation, then finds the shortest list of removals and additions that turns A into B (the Myers algorithm, the same one as the Text Diff Checker). Whitespace counts, because a line break is a token too.

Tokens for OpenAI models are counted exactly with the o200k_base tables in your browser. Claude and Gemini publish no offline tokenizer, so their tokens are estimated from the ratios in the vendor documentation: 2.5 characters per token for Claude (Anthropic model overview) and 4 characters per token for Gemini (Google token guide). Other vendors use the Gemini ratio as a stand-in. The larger of the character and word estimates is used, and marked with ≈.

Cost per call = tokens ÷ 1,000,000 × the model's input price in US dollars per million tokens. Multiply by the number of calls to compare a bigger workload. Output tokens, prompt caching and batch discounts are not included.

Percent change = (B - A) ÷ A.

FAQ

Does fewer tokens always mean a cheaper prompt?

On the input side, yes. The length and price of the answer matter too, and a shorter prompt can change the answer. Compare output quality before you switch.

Why are some token counts marked with ≈?

Only OpenAI counts are exact. For Claude, Gemini and other vendors the count is an estimate from documented character ratios, so it can be off, more so for non-English text, code and numbers.

How current are the prices?

Input prices come from the LLM API Cost Calculator and carry the date they were checked. Vendors change them often, so confirm on the vendor's pricing page before you rely on a figure.

Can I compare a system prompt that is sent with every call?

Yes, that is where savings add up, since the same tokens are sent on every request. Use the calls field for your monthly volume.

Is my prompt uploaded?

No. The diff and the counting run in your browser. The tokenizer table is downloaded from this site once, and your text is never uploaded.