Token WiseToken Wise

Methodology

How Token Wise calculates cost

Every figure shown in the extension comes from a small, deterministic formula applied to each provider's own published per-token rate. Nothing is hidden, fudged, or made up. This page is the full audit trail — you can verify every number yourself.

1. The formula

For any prompt you type, Token Wise runs the same two-step calculation that the major AI providers themselves describe in their pricing pages:

# 1. Estimate tokens from character count
tokens = ceil((characters / 4) × 1.3)
# 2. Apply the model's per-1k-token rate
cost = (tokens / 1000) × inputRate
+ (tokens / 1000) × outputRate

The exact JavaScript lives in extension/utils.js and runs entirely in your browser. There is no remote service involved in producing the estimate.

2. Why ~4 characters per token?

OpenAI publishes the same rule of thumb it uses internally: "1 token is roughly 4 characters or about ¾ of a word in English." Anthropic, Google, and xAI all use byte-pair encoders (BPE) that converge on the same ratio for ordinary English prose, which is why this single heuristic is accurate across providers.

We then multiply by 1.3 as a deliberate safety factor. This means our estimate is intentionally on the slightly-pessimistic side — you will almost never be surprised by a real bill that's higher than what Token Wise predicted. We'd rather quote you 1,000 tokens and have you charged for 920 than quote 800 and have you charged for 950.

For exact token counts on a specific string, OpenAI provides a free tokenizer at platform.openai.com/tokenizer and Anthropic exposes a count_tokens API. Compare any prompt yourself.

3. The per-model rates we use

These are the exact values shipped in the extension's registry (v2026.05.22.1), sourced from each provider's official pricing page. Click any source link to verify.

PlatformModel used as referenceInput / 1k tokOutput / 1k tokSource
PerplexityPerplexity Pro$0.00100$0.00100Official pricing →
ChatGPTGPT-5 (mainline)$0.00250$0.01000Official pricing →
ClaudeClaude Sonnet 4$0.00300$0.01500Official pricing →
GeminiGemini 2.5 Pro$0.00125$0.00500Official pricing →
GrokGrok 4$0.00200$0.01000Official pricing →

Rates reflect the flagship general-purpose model on each platform at the time of the registry version shown above. The extension refreshes from our hosted registry every 12 hours so changes propagate without a manual update.

4. How "optimised cost" is calculated

When you click Optimize, the same formula runs a second time on the rewritten prompt. Savings are the literal arithmetic difference:

savings = originalCost − optimisedCost
savings % = (savings / originalCost) × 100

Worked example, ChatGPT (GPT-5 rates):

CharsTokensCost
Original prompt1,480481$0.00601
Optimised prompt640208$0.00260
Saved840273$0.00341 (57%)

5. What the optimiser actually changes

There's no smoke and mirrors. In local mode (offline, the default fallback) we apply a deterministic ruleset you can read in full at extension/optimizer.js:

  • Strip filler words: please, kindly, just, really, very, simply, basically, actually, literally, in order to
  • Strip polite preambles: could you, would you, can you, I was wondering if, thanks in advance
  • Collapse repeated whitespace and stray newlines
  • Drop hedging adverbs (quite, pretty, fairly, somewhat) when you pick the "Shorter" focus
  • Tidy punctuation spacing and re-capitalise the opening letter

In cloud mode the prompt is sent over HTTPS to our hosted endpoint, which routes it through Google Gemini with a strict system prompt: preserve every requirement, every named entity, and every constraint while removing redundancy. The model never sees who you are — there's no account, no user id, no analytics.

6. Where the estimate can be off

We'd rather tell you the limitations up front than have you discover them on a bill:

  • Tokenisers differ. GPT, Claude, Gemini, and Grok each use their own BPE encoder. The 4-chars-per-token heuristic is accurate within roughly ±15% for English. Code, JSON, or non-Latin scripts can deviate more — the 1.3× safety factor absorbs most of that.
  • Output length is an estimate. The badge assumes the model's reply will be similar in length to your prompt. Long, list-heavy responses will exceed this; short answers will undershoot. The output portion of the cost is therefore the least precise number we show.
  • Provider prices change. When a provider updates their pricing page, we update the hosted registry; your extension picks it up within 12 hours automatically.
  • Subscription plans aren't metered. If you're on ChatGPT Plus or Claude Pro, you aren't billed per token — these costs are the equivalent API spend, a useful proxy for "how heavy is this prompt?", not a literal charge.

7. Verify it yourself

Found a number that doesn't match a provider's current pricing page? Tell us — the registry is open and we update it the same day.