Skip to content

About

Why Calculate Token exists, how the numbers are produced, and where they stop being reliable.

Why this exists

Every provider prices per token, and nobody thinks in tokens. The gap between “this prompt looks short” and what it costs at scale is where budgets go wrong — and it is not intuitive, because the same paragraph tokenizes differently on different models, and code tokenizes far worse than prose.

Most calculators ask you to pick a model first. This one counts every model at once, because the useful question is usually not “what does this cost on GPT” but “which of these should I be using”.

How the numbers are produced

  • GPT counts are exact and local. The real BPE tokenizer runs in your browser, so the count matches what OpenAI would charge and your text is never transmitted to produce it.
  • Claude counts come from Anthropic.There is no published client-side Claude tokenizer, so exact counts use Anthropic’s own token-counting endpoint. When it is unavailable the app estimates from character count and labels the row est rather than quietly showing a worse number as though it were exact.
  • Prices are checked against the articles that quote them. A blog post here declares which figures it cites, and the build fails if one drifts from the model catalogue. Changing a price surfaces every article that needs updating instead of leaving stale numbers published.

11 models are currently covered, including long-context tiers — several providers bill the entire request at an elevated rate once it crosses a threshold, which is the single easiest way to be surprised by an invoice.

Where it stops being reliable

A calculator that oversells itself is worse than no calculator, so: the figures here are estimates of input cost for text you already have. A real bill also includes system prompts, tool definitions, retries, cached input priced differently, and output tokens that do not exist yet. Cached-input pricing is deliberately not modelled, because a cache hit rate depends on how you call the API and cannot be inferred from a block of text.

Use it to compare models and to catch order-of-magnitude mistakes. Verify anything you are going to commit to against your provider’s billing.

Open source

The whole thing is public, including its tests and this page. If a number looks wrong you can read the code that produced it, and the repository is the right place to say so.

Get in touch

Corrections, missing models, and bug reports are all welcome — here is how to reach us. What the service does with your data is set out in the privacy policy.