Back to AI Tools

AI Token Counter

Count tokens for GPT, Claude, Gemini and 20+ LLM models. 100% browser-based with exact GPT tokenization and calibrated estimates for other families.

Try sample
Model
Tokens
Characters
0
Words
0
Bytes
0
Lines
0
Context window
0.0%
0 / 128,000 (0.0%)
Est. cost
$0.0000
Total
Tokenizer
o200k_base
Est.

Estimated cost

Pricing updated 2026-05-07
Input
$0.0000
Output
$0.0000
Total
$0.0000
View official pricing

Token visualization

Type or paste text above to see tokens

Encodes text in URL hash. Anyone with the URL can read your prompt.

Frees ~600KB-2MB of browser storage.

Frequently asked questions

Why are some models marked Estimated?

OpenAI publishes their tokenizer vocab (cl100k_base, o200k_base) so we can match API counts 1:1. Anthropic, Google, and others don't publish their vocab, so we calibrate against o200k_base or use character heuristics. Accuracy is roughly 3-8%, sufficient for cost planning.

Does my prompt leave the browser?

No. Tokenization runs entirely client-side. The vocab files are downloaded once (cached in IndexedDB) and your text never reaches our servers.

Why does the page download up to 2MB the first time?

GPT tokenizers use a vocabulary of 100K-200K subword tokens. We download this vocab once and cache it in IndexedDB. After that, tokenization works offline. Use Privacy → Clear cached vocab to remove it.

How accurate is the Claude estimate?

We use o200k_base × 1.04, calibrated against sample texts. Mean absolute error is around 3%. For exact counts, call Anthropic's tokens.count() endpoint.

What does the context bar show?

It shows current tokens vs the model's maximum context window. Going over the limit will result in API errors or truncation.

Are the prices up to date?

We track pricing manually (currently 2026-05-07). Click the official link next to each model's price to verify with the provider's pricing page.

Where can I see the BPE implementation?

We hand-write the GPT-style BPE tokenizer in TypeScript. The source lives under src/features/token-counter/lib/ in our public repo. We do not depend on tiktoken / gpt-tokenizer.

Related Tools