Trust · Transparency

How AITokenCalculator works

No black boxes. Here is exactly how tokens are estimated, how costs are computed, where pricing data comes from, and when it is refreshed.

1 · Token estimation

Each model uses a specific tokenizer, and each tokenizer packs characters into tokens at a different density. We maintain measured density profiles rather than one lazy average:

TokenizerLatinCJKCodeChars / token
cl100k_base 4 1.5 2.5 per script mix
o200k_base 4 1.5 2.5 per script mix
Claude BPE 4 1.4 2.5 per script mix
SentencePiece 3.7 1.3 2.4 per script mix
Llama BPE 4 1.5 2.5 per script mix

Your text is analysed script-by-script (Latin, CJK, code, Arabic, Devanagari) and each segment contributes tokens at its own density — so a mixed English/Chinese/code prompt gets a far better estimate than any single-ratio rule of thumb.

2 · Cost computation

Costs are computed from each model's official rates: input cost = input tokens × input price ÷ 1,000,000, likewise for output. On top of the base we apply the provider's real discount mechanics:

The same engine powers this website's calculator and every static number on the comparison pages.

3 · Pricing data sources

Rates are verified by hand against each provider's official pricing page, then kept fresh by an automated sync workflow. Last full verification: August 20, 2026. Official sources:

4 · Limitations (the honest part)

Spotted something off? It's a static site built to be corrected fast — the pricing registry lives in one reviewed file and updates ship within hours.

Methodology FAQ

Are token counts exact?

No — they are high-accuracy estimates based on per-tokenizer character density (about ±5% for typical English). For exact counts use the provider's own tokenizer; for budgeting, planning and comparisons, our estimates are purpose-built.

Where do prices come from?

Every rate is manually verified against the provider's official pricing page, and an automated GitHub Action re-syncs the registry regularly. The verification date is printed on every page.

Does anything I type leave my browser?

No. All estimation runs client-side in JavaScript. No text, file or workload data is uploaded, stored or logged.

Why do my real bills differ from estimates?

Real invoices include factors estimates can't know: exact tokenizer output, provider-side retries, image tiling nuances, tiered context pricing and taxes. Treat estimates as planning numbers with a safety margin.