Token Counter
Count tokens for GPT, Claude, Gemini, Llama, Mistral, and other models.
Tokenization runs entirely in your browser. Your text is never uploaded.
| Provider | Model | Tokens | Accuracy | Input cost |
|---|---|---|---|---|
| OpenAI | GPT-5.5 | — | exact | — |
| OpenAI | GPT-5.4 mini | — | exact | — |
| Anthropic | Claude Opus 4.7 | — | estimate | — |
| Anthropic | Claude Sonnet 4.6 | — | estimate | — |
| Gemini 3.1 Pro | — | estimate | — | |
| DeepSeek | DeepSeek V4 Pro | — | exact | — |
| Meta | Llama 4 Maverick | — | estimate | — |
| xAI | Grok 4.3 | — | estimate | — |
How accurate is this?
Exact tokenizers — for OpenAI we run js-tiktoken locally with the right encoding (o200k_base for the GPT-5.x family, cl100k_base for older models). For DeepSeek and Qwen we load the official Hugging Face tokenizer.json files on demand via @huggingface/transformers — the bundle is code-split so it only downloads when you first select one of those models.
Estimates — for Anthropic, Google, and xAI we use OpenAI's cl100k_base as a proxy because those providers don't publish their tokenizers. Meta and Mistral do publish theirs, but the canonical Hugging Face repos are license-gated and unreachable from a browser without auth, so we use the same cl100k_base proxy for them. Counts are typically within ~10–20% of the real tokenization, but treat them as approximations — especially for capacity planning or billing.
Note on Claude Opus 4.7 — Anthropic shipped a new tokenizer with Opus 4.7 that produces up to ~35% more tokens for the same input than older Claude models. Our cl100k_base proxy will under-count for that model in particular.
Tokenizers can change between model versions and even between minor revisions. If a number matters for production decisions, verify with the provider's own counting endpoint.
Pricing reflects public list pricing as of 2026-05-10 and may not include volume discounts, batch pricing, or context-cache rates. Check the provider's pricing page before relying on these numbers.