---
title: "Prompt token diff: compare two prompts in tokens and cost"
description: "Compare two versions of a prompt with a real tokenizer: changed lines highlighted, the exact token difference and what it adds to or saves on a monthly bill."
url: https://broadrouter.com/tools/prompt-token-diff/
lang: en
updated: 2026-11-15
publisher: BroadRouter (a BroadNet site); API by BroadNet Inference, https://inference.broadnet.ai
---

# Prompt token diff

Updated 2026-11-15

**In short:** A prompt edit changes your bill by token delta × requests per day × days ÷ 1,000,000 × input price per million. Cutting 500 tokens from a system prompt sent 10,000 times a day removes 150 million input tokens a month, $26.25 on DeepSeek V4.1 Flash. Paste two versions for changed lines, exact token counts and the monthly difference.

Free, no sign-up, runs in your browser: nothing you type is sent anywhere.

Two prompts

Current prompt (A)You are a helpful, friendly and professional customer support assistant for an online electronics store. Always be polite and courteous to the customer at all times. Please make sure that you always answer in the same language that the customer used to write their message. If the customer writes in Arabic, you must answer in Arabic. If the customer writes in English, you must answer in English. You should never, under any circumstances, make up order numbers, prices or delivery dates. If you do not know the answer to a question, please say that you do not know and offer to connect the customer with a human agent. Keep your answers short and to the point, ideally no longer than three or four sentences. Format: plain text only. Do not use Markdown, bullet points or headings in your replies.

New prompt (B)You are a support assistant for an online electronics store. Reply in the customer's language (Arabic or English). Never invent order numbers, prices or delivery dates. If unsure, say so and offer a human agent. Keep replies to 3-4 sentences. Format: plain text, no Markdown.

Model to priceDeepSeek V4.1 FlashGLM 5.3Qwen3.8 27BBroadNet Gemma 4 VL 26BAnother provider's model (428 in our price database)…Custom prices

Search a model by name

Prices are each model's cheapest listed standard price, read from providers' own pricing pages (newest check 2026-11-15).

Input, per 1MCached input, per 1MOutput, per 1MContext window, tokens (optional)

TokenizerDeepSeek V4.1 Flash (2 MB download)GLM 5.3 (20 MB download)Qwen3.8 27B (13 MB download)Gemma 4 VL 26B (32 MB download)GPT (o200k) (1.1 MB download)Requests per dayDays per monthCached input, %Share of the prompt billed at the cached price

Tokens in A

—

Tokens in B

—

Difference

—

Cost change a month

—

## What changed

[Get started](https://inference.broadnet.ai/account/?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-prompt-token-diff&utm_content=tool-account) ·

The link keeps the model and numbers, never your prompts.

Prompt input cost only, before tax. BroadNet prices synced 2026-11-14; other models use the cheapest standard price listed on a provider's own page in our database. Until you count exact tokens, the counts are estimates from measured characters per token for the text's script, labelled as such.

[Report a wrong price or number](mailto:info@broadnet.ai?subject=Wrong%20price%20or%20number%20on%20Prompt%20token%20diff&body=Page%3A%20https%3A%2F%2Fbroadrouter.com%2Ftools%2Fprompt-token-diff%2F%0A%0AWhat%20looks%20wrong%20(model%2C%20figure%20shown%2C%20correct%20figure%20and%20a%20source%20link%20if%20you%20have%20one)%3A%0A) (email to info@broadnet.ai, with this page's link and your inputs filled in).

## How it works

1.  Paste the current prompt on the left and the new version on the right, or edit the example.
2.  Choose the model you call. The matching tokenizer is selected; press Count tokens to download it once (it is cached).
3.  Enter requests per day, days per month and your measured cached-input share.
4.  Read the exact token counts, the difference, the monthly cost change and the highlighted lines that changed.

## The formula

```
token delta     = tokens(B) − tokens(A)
monthly tokens  = token delta × requests per day × days
monthly change  = monthly tokens × (1 − cache share) × input price ÷ 1,000,000
                + monthly tokens × cache share × cached price ÷ 1,000,000
```

A negative change is a saving. When the model publishes no cached price, the cache share is ignored and every token is billed at the input price.

## Worked example

The example above trims a support assistant's system prompt: polite filler goes, and each rule becomes one short line. Press Count exact tokens to see the real difference with each tokenizer. At 10,000 requests a day, every 500 tokens removed is 150 million input tokens a month, $26.25 on DeepSeek V4.1 Flash.

## Where prompt tokens hide

-   **Filler and repetition.** "Please make sure that you always" carries no instruction. Say each rule once.
-   **Examples.** Few-shot examples can be the largest block. Keep the one or two that change behaviour.
-   **Tool definitions and schemas.** Long descriptions and unused tools are sent on every call.
-   **Language.** The same instruction in Arabic usually takes more tokens than in English; see the [Arabic token counter](https://broadrouter.com/tools/arabic-token-counter/).

Test a shorter prompt on real inputs before you ship it: fewer tokens is only a saving if the answers stay as good.

## Questions

### How do I count the token difference between two prompts?

Tokenize both versions with the tokenizer of the model you call and subtract. Character or word counts are only estimates, and the gap differs by language and tokenizer. This tool runs the real tokenizer in your browser and shows both counts, the difference and the lines that changed.

### How much does removing prompt tokens save?

Monthly saving = tokens removed × requests per day × days ÷ 1,000,000 × input price per million. 500 tokens fewer on 10,000 requests a day for 30 days is 150 million input tokens, $26.25 a month on DeepSeek V4.1 Flash at its uncached input price.

### Does prompt caching change the saving?

Yes. If the system prompt is a cached prefix, most of it is billed at the cached price, so shortening it saves less. With 80% of input cached on DeepSeek V4.1 Flash, the same 500 tokens save $5.91 a month. Enter your measured cache share. Editing the start of a prompt also invalidates the cache until the new prefix is cached.

### Why do two tokenizers give different counts for the same prompt?

Each model family trains its own vocabulary, so the same text splits into different pieces. Arabic, code and numbers vary most. Count with the tokenizer of the model you actually call; for Gemma the tool uses Google's base-model tokenizer and says so.

### Are chat template tokens included?

No. The counts are for the text alone. Chat formatting adds a few tokens per message, the same for both versions, so the difference between them is unaffected.

### Is my prompt sent anywhere?

No. The tokenizer file downloads once from Hugging Face (or the GPT bundle from this site) and runs in your browser. Your prompts never leave the page and are not stored in the page address.

## Go deeper

-   [How to reduce prompt tokens](https://broadrouter.com/blog/reduce-prompt-tokens/)
-   [LLM token counter](https://broadrouter.com/tools/token-counter/)
-   [Prompt caching savings calculator](https://broadrouter.com/tools/prompt-caching-calculator/)
-   [Structure prompts for caching](https://broadrouter.com/blog/prompt-structure-for-caching/)
-   [Count tokens before you send](https://broadrouter.com/blog/count-tokens-before-sending/)
-   [Glossary: system prompt](https://broadrouter.com/glossary/system-prompt/)

## More free tools

-   [**LLM API cost calculator**Price a workload on every model at once, with cache hits, reasoning and a flat-plan check.](https://broadrouter.com/tools/llm-api-cost-calculator/)
-   [**Speech-to-text cost calculator**Hours, calls or voice notes to a monthly transcription bill, against your current provider.](https://broadrouter.com/tools/speech-to-text-cost-calculator/)
-   [**LLM token counter**Exact token counts with each model's real tokenizer, with a token view and cost.](https://broadrouter.com/tools/token-counter/)
-   [**Arabic token counter**Arabic vs English token counts per tokenizer: the "Arabic tax" in tokens and money.](https://broadrouter.com/tools/arabic-token-counter/)
-   [**Tokens to words converter**Tokens ↔ words ↔ characters ↔ pages, by language and content type.](https://broadrouter.com/tools/tokens-to-words/)
-   [**Context window calculator**Will it fit? Window used per model, room left for output, cost to send.](https://broadrouter.com/tools/context-window-calculator/)
-   [**Flat-rate vs per-token LLM cost calculator**Break-even between an unlimited plan and paying per token, per agent.](https://broadrouter.com/tools/flat-rate-vs-per-token-calculator/)
-   [**Prompt caching savings calculator**Bill with and without caching, by prefix share and hit rate.](https://broadrouter.com/tools/prompt-caching-calculator/)
-   [**Image token calculator**Tokens and cost per image under each model's documented rule. Drop an image; nothing is uploaded.](https://broadrouter.com/tools/image-token-calculator/)
-   [**Self-hosting vs API cost calculator**GPU rental against your current API and BroadNet per-token and flat-plan prices: cost per 1M tokens and break-even volume.](https://broadrouter.com/tools/self-hosting-vs-api-calculator/)
-   [**Embedding cost calculator**Index, update and query costs for a corpus at OpenAI, Google, Voyage, Mistral and Jina list prices.](https://broadrouter.com/tools/embedding-cost-calculator/)
-   [**LLM rate limit and concurrency calculator**Which limit binds first: RPM, TPM or concurrency, with Little's law.](https://broadrouter.com/tools/llm-rate-limit-calculator/)
-   [**JSON schema generator for LLM structured output**Sample JSON to strict schema, Pydantic, Zod and a ready request.](https://broadrouter.com/tools/json-schema-generator/)
-   [**OpenAI-compatible API request builder**One request, copied as curl, Python, Node or the OpenAI SDKs.](https://broadrouter.com/tools/api-request-builder/)
-   [**Audio file splitter for speech-to-text limits**Chunk count, overlap and copy-ready ffmpeg commands to fit a transcription file-size limit.](https://broadrouter.com/tools/audio-splitter-ffmpeg/)
-   [**Agent run cost estimator**Context growth per step, total tokens and cost of one agent run, with a DeepSeek session comparison.](https://broadrouter.com/tools/agent-run-cost-estimator/)
-   [**OpenAI to BroadNet migration helper**Paste OpenAI SDK code; get base URL, key and model edits, a diff and the checks that remain.](https://broadrouter.com/tools/openai-to-broadnet-migration/)
-   [**Arabic text normalizer**Tashkeel, tatweel, alef, ya, ta marbuta, digits and invisible characters, with a matching Python function.](https://broadrouter.com/tools/arabic-text-normalizer/)
-   [**RAG chunking calculator**Chunks, embedding tokens, input per query, context check and monthly LLM cost for a RAG pipeline.](https://broadrouter.com/tools/rag-chunking-calculator/)
-   [**max\_tokens calculator for reasoning models**Answer length + reasoning budget + margin = a max\_tokens that does not cut the answer off.](https://broadrouter.com/tools/reasoning-token-budget/)
-   [**LLM batch job planner**Run time, binding limit, cost per model and the flat sessions needed to finish a big job by a deadline.](https://broadrouter.com/tools/llm-batch-job-planner/)
-   [**LLM JSON output validator**Parse errors by line and column, safe repairs, cut-off detection and JSON Schema checks for model output.](https://broadrouter.com/tools/llm-json-output-validator/)

Try it on your real workload. New accounts start with $5 of credit for Gemma and transcription. DeepSeek, GLM and Qwen3.8 need a top-up.

[Get started](https://inference.broadnet.ai/account/?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-prompt-token-diff&utm_content=page-cta) ·

**Sources**

-   [BroadNet Inference machine-readable prices (pricing.json)](https://inference.broadnet.ai/pricing.json?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-prompt-token-diff&utm_content=sources)
-   [DeepSeek V4.1 Flash tokenizer: tokenizer.json from deepseek-ai/DeepSeek-V4.1-Flash, pinned commit 314113f (checked 2026-11-14)](https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash/tree/314113f8a7dadb388215396ba5fbee2c610a04d6)
-   [GLM 5.3 tokenizer: tokenizer.json from zai-org/GLM-5.3, pinned commit ba32f8c (checked 2026-11-14)](https://huggingface.co/zai-org/GLM-5.3/tree/ba32f8c19c8738e2c57c71798c601d477a7bf844)
-   [Qwen3.8 27B tokenizer: tokenizer.json from Qwen/Qwen3.8-27B, pinned commit 3756181 (checked 2026-11-14)](https://huggingface.co/Qwen/Qwen3.8-27B/tree/37561816e66b5b9153b1b64c10968c18c1e6f4a0)
-   [Gemma 4 tokenizer (Google base model): tokenizer.json from google/gemma-4-26B-A4B-it, pinned commit 4d7ae49 (checked 2026-11-14)](https://huggingface.co/google/gemma-4-26B-A4B-it/tree/4d7ae4984b7db7de8f8457170b3f1a419ee76d52)
-   [gpt-tokenizer (o200k\_base) for the GPT reference count](https://github.com/niieani/gpt-tokenizer)
-   [BroadRouter tokenizer efficiency dataset: characters per token used for the estimates](https://broadrouter.com/data/tokenizer-efficiency/)
-   [BroadNet Inference API reference: cached tokens in usage, billed at the cached input price (checked 2026-11-15)](https://inference.broadnet.ai/docs?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-prompt-token-diff&utm_content=sources)
-   [BroadNet Inference prices](https://inference.broadnet.ai/pricing?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-prompt-token-diff&utm_content=sources)
