Token counter (OpenAI tokenizer), with what your prompt costs on 25 models
Paste your prompt below. It counts tokens with OpenAI's o200k_base tokenizer as you type, entirely in your browser: your text is not sent anywhere. The table under it turns the count into a cost per request and per month on 25 models.
Runs in your browser: the text doesn't leave your device.
What this prompt costs on each model
| Model | Input tokens | Per request | Per month |
|---|
Every row uses the o200k_base count. Other labs' tokenizers (and OpenAI's GPT-6 tokenizer, which isn't published) split text differently, so treat the cost as an estimate: the real count can be higher or lower. Prices are list prices per million tokens from OpenRouter's public model list (December 2026), without cache or batch discounts. Input is billed on the prompt, output on the answer; reasoning tokens are billed as output too.
Why the same text has different token counts
Each lab trains its own tokenizer, a fixed vocabulary of text pieces, and the model is billed on how many of those pieces your text splits into. Common English words are usually one token each; rare words, code, numbers, JSON punctuation and most non-English languages split into more. The same prompt can come out noticeably larger on one lab than on another, and a lab can change tokenizers between model generations: Anthropic, for example, notes that its newer Claude models count the same text higher than models before Claude Opus 4.7. So a price per million tokens is only comparable together with the token count on that model. To know the gap for your text, count it with each lab's own endpoint.
How the count on this page is made
o200k_base is the open tokenizer that OpenAI's tiktoken library maps to GPT-4o, GPT-4.1 and GPT-5. It runs here in your browser (the open-source gpt-tokenizer library). OpenAI hasn't published the tokenizer of its GPT-6 models, and Claude and Gemini tokenizers are not public, so for those models the count here is an estimate. For an exact number, use the lab's own counting endpoint (below) or the usage field of a real response.
Count tokens in your own code
For OpenAI models with a published tokenizer, count locally with tiktoken:
import tiktoken
enc = tiktoken.get_encoding("o200k_base")
print(len(enc.encode(text)))
For any current model, use the labs' counting endpoints: OpenAI's /v1/responses/input_tokens, Anthropic's /v1/messages/count_tokens and Google's Gemini countTokens. Anthropic's docs say its token counting is free (with a rate limit). Every API response also reports the real usage after the call, which is the number you are billed on, reasoning tokens included.
From token count to monthly bill
Cost per request = input tokens × input price ÷ 1,000,000 + output tokens × output price ÷ 1,000,000. The table above does it for 25 models; the LLM API cost calculator explains why the real bill drifts from the estimate (retries, conversation history, caching), and the pricing comparison lists the prices. The cheapest model for your prompt is only a saving if its answers still pass: how to compare models on your own prompts.