How it works
When you paste text into the calculator, the page tokenizes it locally — in JavaScript, on your browser, using the same kind of byte-pair encoders the model vendors use. For inputs longer than 50,000 characters, the work moves to a Web Worker so the page stays responsive. The number you see is computed on your machine and multiplied by the per-million pricing the vendor publishes.
OpenAI ships a canonical client-side tokenizer (o200k_base), so GPT-5 and GPT-4.1 counts are exact. Anthropic and Google don't publish current client tokenizers, so we approximate Claude with cl100k_base and Gemini with o200k_base, applying per-model calibration to nudge the result toward the vendor counts. In practice the drift is ±2–3% on typical English and code; treat those numbers as budgeting estimates, not billing reconciliations.
What we promise
- Your prompt never leaves your browser. There is no server endpoint that ever receives prompt text. The only serverless function on this site is
/api/og— used to render social preview images — and it only accepts two short query strings used in the OG card itself. Verify on GitHub. - Analytics are aggregate. We use Vercel Web Analytics for page-level metrics and Microsoft Clarity for session replay; both are configured to mask the prompt textarea and cost totals. See the privacy policy for specifics, or the verify-privacy panel on the calculator for a live tally.
- Pricing data is dated. Every model carries a
dataAsOfstamp showing when we last verified its rate against the vendor's public pricing page. See pricing data for the current table.
Who maintains the numbers
The pricing tables and per-model write-ups are maintained by the tokenmath Research Desk. The rule is simple and the only credential we claim: every rate is taken from the vendor's own published pricing page, dated, and re-checked on each refresh — if a number can't be linked to a primary source, it doesn't ship. Each model carries the dataAsOf stamp and source link it was verified against (see pricing data), and every pricing page shows when it was last verified. We don't publish invented author bios or credentials — just the methodology and the sources, which you can check.
Built by
tokenmath is part of the Vertex Network— a small set of developer + creator tools sharing a common stack and design language. For a running list of what's shipped, see the changelog.