Token Counter & API Cost Calculator
Paste a prompt to count tokens with OpenAI’s tiktoken encodings and compare what it would cost on GPT, Claude, Gemini, Grok, Mistral, DeepSeek, Qwen, Kimi, GLM, Doubao, Hunyuan, MiniMax and Xiaomi MiMo.
TL;DR: Paste text to get exact OpenAI tiktoken counts (o200k_base / cl100k_base) and a side-by-side API cost estimate for 33 models from 13 vendors; other vendors’ counts are labelled estimates, and nothing leaves your browser.
API cost comparison
| Model | Input tokens | $ / 1M in | $ / 1M out | Input cost | Output cost | Total | Source |
|---|
Prices checked 2026-10-22 on each vendor’s official page (USD, standard tier, no caching or batch discounts). tiktoken = counted locally with o200k_base. estimate = approximated from the o200k count (Claude ×1.3). Vendors change prices often — confirm before you budget.
How to use the token counter
- Paste your prompt, system message or document into the box (or open a text file).
- Read the exact o200k_base and cl100k_base counts. Toggle the boundary view to see how text is split.
- Enter how many output tokens you expect and how many requests you will send to compare total cost per model.
Related guides: How tokens work and how to estimate cost · API price comparison · Prompt caching basics · MiMo V2.5 → V2.6 migration · How to get LLM API keys · Monthly cost calculator
FAQ
Which counts are exact?
The o200k_base and cl100k_base numbers are computed locally with js-tiktoken, the JavaScript port of OpenAI’s tiktoken. o200k_base is the encoding used by GPT-4o and later OpenAI models; OpenAI has not published a separate tokenizer for the GPT-6 family, so for billing-exact numbers on a specific model use OpenAI’s input-token counting endpoint.
How are Claude, Gemini, Grok, DeepSeek, Qwen, Kimi, GLM, MiMo and other non-OpenAI tokens estimated?
These vendors do not ship an official browser tokenizer, so the table uses the o200k_base count as an approximation. For Claude it multiplies by 1.3, because Anthropic states that Claude 4.7 and later models use a newer tokenizer that produces about 30% more tokens. Treat these rows as estimates; Anthropic and Google both offer token-counting APIs for exact numbers.
Where do the prices come from?
Each price is the standard (non-batch, non-cached) per-million-token rate copied from the vendor’s official pricing page on 2026-10-22. Each row links to its source. Promotional prices and their end dates are noted where the vendor lists them.
Does the cost include cached input, batch or thinking tokens?
No. The calculator uses the standard input and output rates. Reasoning/thinking tokens are billed as output by most vendors, so include them in “expected output tokens”. Batch APIs are usually 50% cheaper.
Is my text sent anywhere?
No. Tokenization runs entirely in your browser. You can disconnect from the internet after the page loads and it still works.