Skip to main content
tokenmath
Menu

About

A small, opinionated tool.

tokenmathis a calculator for two questions every team building with Anthropic Claude, Google Gemini, or OpenAI's GPT family ends up asking: how many tokens is this prompt, and what is it going to cost? It exists because answering those questions shouldn't require pasting your prompt into someone else's server.

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

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.

Keyboard shortcuts

Press ? any time to reopen this list.

Show this overlay?
Toggle themet
Focus the prompt textarea/
Go to homegh
Go to modelsgm
Go to pricing datagp
Go to changeloggc
Go to aboutga
Close overlays / dialogsEsc

We use Vercel Web Analytics for aggregate page metrics and (optionally) Microsoft Clarity for masked session replay. Prompt content is never sent. Read the privacy policy.