Token Count Diff Tool

Compare token counts between two prompt versions

Ad placeholder (leaderboard)

Token count diff tool

When you tighten a prompt, the net token number tells you whether you won — but not where. This tool puts two versions side by side, reports the exact token delta and the cost change at your call volume, and shows a word-level diff so you can see precisely which sentences you cut and which you accidentally grew.

How it works

Each version is tokenized with a character-based heuristic that closely matches tiktoken for English. The tool reports tokens for A, tokens for B, and the difference. It multiplies that difference by the chosen model’s input price per million tokens and your number of calls to give a cost delta. A simple word-level longest-common-subsequence diff then highlights additions in one color and removals in another. Everything runs locally.

Tips and notes

Use this when iterating on a high-traffic system prompt: a five-token saving on an endpoint that fires a million times a day is real money. The diff is most useful for catching accidental bloat — a clarification you added “just in case” that doubled a sentence. Token counts vary by tokenizer, so the delta is more reliable than the absolute numbers; if both versions use the same language and style, the difference is accurate even when the totals drift a little. Re-test behavior after any cut, since a leaner prompt can subtly change output.

Ad placeholder (rectangle)