Token Counter: Count Tokens and Cost by AI Model
Paste a prompt to get a real token count from OpenAI's o200k_base tokenizer, plus words and characters, as you type. A table shows what the prompt costs as input on each AI model, its context window and how much of it the prompt fills, using dated prices from OpenRouter. Add expected output tokens to include the reply. Free, no sign-up.
Built by Jose Hunt · Checked 25 Nov 2026
Prices from OpenRouter, checked 25 November 2026
| Model | Tokens | Input / 1M | Context window | Share | |
|---|---|---|---|---|---|
| OpenAI: GPT-6.2 Sol | ~0 estimate | $2.00 | $0 | 1,050,000 | 0% |
| OpenAI: GPT-5.5 | 0 exact | $5.00 | $0 | 1,050,000 | 0% |
| OpenAI: GPT-5.4 Mini | 0 exact | $0.75 | $0 | 400,000 | 0% |
| OpenAI: GPT-4.1 | 0 exact | $2.00 | $0 | 1,047,576 | 0% |
| OpenAI: GPT-4o-mini | 0 exact | $0.15 | $0 | 128,000 | 0% |
| Anthropic: Claude Opus 5.5 | ~0 estimate | $4.00 | $0 | 1,000,000 | 0% |
| Anthropic: Claude Sonnet 5.5 | ~0 estimate | $2.00 | $0 | 1,000,000 | 0% |
| Anthropic: Claude Haiku 5.5 | ~0 estimate | $0.10 | $0 | 1,000,000 | 0% |
| Google: Gemini 4 Neon | ~0 estimate | $3.00 | $0 | 1,048,576 | 0% |
| Google: Gemini 3.8 Flash | ~0 estimate | $0.825 | $0 | 1,048,576 | 0% |
| SpaceXSI: Grok 4.7 | ~0 estimate | $2.00 | $0 | 500,000 | 0% |
| DeepSeek: DeepSeek V4.1 Flash | ~0 estimate | $0.0507 | $0 | 1,048,576 | 0% |
| Meta: Llama 4 Maverick | ~0 estimate | $0.35 | $0 | 524,288 | 0% |
| Mistral: Mistral Large 4 | ~0 estimate | $0.70 | $0 | 1,048,576 | 0% |
Free, no sign-up. The tools run on our server. We don't store what you enter. This tool doesn't use AI and doesn't send your prompt anywhere else.
How to use
Paste a prompt to count its tokens with OpenAI's o200k_base tokenizer and see what it costs as input on each model.
The count is exact for OpenAI models that use o200k_base and an estimate for every other model.
- Real tokenizer, not characters ÷ 4
- Dated prices from OpenRouter
- Copy results as text or an image
What is a Token Counter?
A token counter is a tool that tells you how many tokens a piece of text uses, which is how AI models measure input, limits and price. A token is a chunk of text: often a whole common word, sometimes part of a word, a space or a punctuation mark.
This one runs a real tokenizer, o200k_base, the encoding OpenAI's tiktoken library uses for GPT-4o, GPT-4.1, the GPT-5 family and the o-series models. It doesn't divide characters by 4. That makes it an exact OpenAI token counter for those models. For Claude, Gemini and every other model, each with its own tokenizer, the same number is an estimate, and the table says so on every row.
The cost table works as an LLM cost calculator: tokens times each model's listed input price, plus output if you add it. It's also a quick way to turn tokens to words for your own text, because it shows both counts side by side.
To make a prompt shorter, use the Token Reducer. For ways to cut tokens by hand, see how to reduce AI prompt tokens, and for what we measured when compressing 50 real prompts, see our prompt compression study.
When should you use it?
- check_circle Checking whether a long prompt or document fits a model's context window before you send it
- check_circle Comparing what the same system prompt costs across OpenAI, Anthropic, Google and other models
- check_circle Budgeting an app that sends the same prompt thousands of times a day
- check_circle Seeing how a word or a line of code splits into tokens
Example outputs
How it works
Tokens: your text goes through the o200k_base encoding in Microsoft.ML.Tokenizers on our server. It's the same encoding as OpenAI's tiktoken; we checked that both give the same counts on English, Bulgarian and code samples. The count updates as you type. The token view shows each token in its own color, up to the first 2,000, with ↵ for a line break.
Exact or estimate: tiktoken maps OpenAI's o1, o3, o4-mini, GPT-4o, GPT-4.1, GPT-4.5 and GPT-5 model names to o200k_base (tiktoken, checked 25 November 2026). Those rows say exact. Every other row says estimate. Claude, Gemini, Grok, Llama, DeepSeek and Mistral split text with their own tokenizers, so their real count can be higher or lower. OpenAI's GPT-6 models and gpt-oss aren't mapped to o200k_base in tiktoken, so they're estimates too.
Words are runs of letters, digits, apostrophes and hyphens, the same rule as our Word Counter. Characters are counted in UTF-16 units, so most emoji count as 2.
Prices and context windows come from OpenRouter's public model list (OpenRouter). We fetch it at most once a day, and the date above the table is when we last did. If a fetch fails, the table keeps the last prices with their date. If we've never fetched them since the server started, the table is hidden and only the counts show. Prompt cost is tokens times the input price. With expected output tokens, the output price for those is added. Share is your prompt's tokens divided by the model's context window.
Copy results copies the table as text, and Copy as image copies it as a picture. Neither includes your prompt. Copy link keeps only your model selection. The tools run on our server. We don't store what you enter. No AI model is used.
Tips for better results
- tips_and_updates For Claude or Gemini, use the provider's own counter when you need the exact number. Anthropic's token counting is free to use, with rate limits (Anthropic), and the Gemini API has count_tokens (Google). Both checked 25 November 2026.
- tips_and_updates Leave room in the context window for the answer, not just the prompt.
- tips_and_updates Check the date above the table. Prices change, and your provider or plan may charge differently from OpenRouter's list.
- tips_and_updates Use Copy link to share a model comparison. The link keeps the models you picked, not your text.