token AI

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

Tokens 0
Words 0
Characters 0
Models

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.

info

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

Sample text: Before you send a long prompt to an AI model, it helps to know how big it is. Models don't read words. They read tokens, which are chunks of text that can be a whole word, part of a word, a space or a punctuation mark. Common English words are usually one token each. Longer or rarer words, numbers, code and text in other languages often take several. That's why a word count is only a rough guide to cost. Every model charges by the token, and every model has a limit on how many tokens it can handle in one request, counting your prompt and its answer together. If your prompt fills most of that window, the answer may be cut short. Counting tokens first lets you trim the prompt, pick a cheaper model or split the job into smaller parts.
Result: 162 tokens with o200k_base, 142 words, 741 characters. That's about 1.14 tokens per word, or about 880 words per 1,000 tokens.
What to notice: common words like "Before" and "model" are one token each, and the count is exact for the OpenAI models marked exact. Code, long numbers and text in other languages usually take more tokens per word, so run your own text rather than relying on a ratio.

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.

Frequently Asked Questions

What is a token?
A chunk of text that an AI model reads as one unit. It can be a whole word, part of a word, a space or a punctuation mark. Models count input, limits and price in tokens, not words.
How many words is 1,000 tokens?
About 880 words of plain English, going by the sample text on this page: 142 words came to 162 tokens with o200k_base. Code, numbers and other languages use more tokens per word, so paste your own text to check.
How do I count tokens for OpenAI models?
Paste your text above. The count uses o200k_base, which tiktoken maps to GPT-4o, GPT-4.1, the GPT-5 family, o1, o3 and o4-mini (tiktoken, checked 25 November 2026). For those models it's exact. GPT-6 models aren't in that list, so the table marks them as estimates.
Do Claude and Gemini count tokens the same way?
No. Each uses its own tokenizer, so the o200k_base count is an estimate for them and the table labels it that way. For an exact figure, Anthropic offers free token counting with rate limits (Anthropic) and the Gemini API has count_tokens (Google). Both checked 25 November 2026.
How much does my prompt cost on each model?
The table shows it: tokens times each model's input price, using OpenRouter's listed prices and the date we fetched them. Add expected output tokens to include the reply. Your bill depends on the provider and plan you use, so check its price page for anything that matters.
How many tokens fit in a context window?
Each model has its own limit. The table shows the context window OpenRouter lists for each model, and the Share column shows how much of it your prompt fills. Leave room for the answer too.

Related tools