Free tool
Token counter for GPT, Claude and Gemini
Then see what the prompt costs on 10 popular models. Nothing is sent anywhere.
- GPT tokens
- 0
- o200k_base, exact: GPT-4o, GPT-4.1, GPT-5, o-series
- GPT-4 tokens
- 0
- cl100k_base, exact: GPT-4, GPT-3.5
- Words
- 0
- Characters
- 0
Estimate from the GPT count. Anthropic doesn't publish an offline tokenizer, so the real number can differ. Exact count: POST /v1/messages/count_tokens
Estimate from the GPT count. Google doesn't publish an offline tokenizer, so the real number can differ. Exact count: models.countTokens
What this prompt costs
Input is the GPT o200k count (0 tokens) for every model, so Claude and Gemini rows are estimates. List prices per 1M tokens, checked 2026-10-08, no caching or batch discounts.
| Model | Input / 1M | Output / 1M | Per call | Per 1,000 calls |
|---|---|---|---|---|
| GPT-6 Astra OpenAI | $10 | $50 | $0.025 | $25.00 |
| GPT-6.1 Sol OpenAI | $2 | $10 | $0.0050 | $5.00 |
| GPT-6 Luna OpenAI | $0.1 | $0.5 | $0.00025 | $0.25 |
| GPT-5.3 Codex OpenAI | $1.75 | $14 | $0.0070 | $7.00 |
| Claude Opus 5.5 Anthropic | $4 | $20 | $0.010 | $10.00 |
| Claude Sonnet 5.5 Anthropic | $2 | $10 | $0.0050 | $5.00 |
| Claude Haiku 5.5 Anthropic | $0.1 | $0.5 | $0.00025 | $0.25 |
| Gemini 3.1 Pro Preview Google | $2 | $12 | $0.0060 | $6.00 |
| Gemini 3.8 Flash Google | $0.75 | $3.75 | $0.0019 | $1.88 |
| Gemini 3.1 Flash-Lite Google | $0.25 | $1.5 | $0.00075 | $0.75 |
How tokens work
A language model doesn't read letters or words. A tokenizer first splits the text into tokens: common words are usually one token, longer or rarer words are split into pieces, and spaces, punctuation and digits are tokens too. The model's context window, its rate limits and its price are all counted in tokens.
Each model family has its own tokenizer, so the same text gives different counts. OpenAI publishes its tokenizers (o200k_base and cl100k_base), which is why this page can count GPT tokens exactly. Anthropic and Google don't, so for Claude and Gemini you get an estimate here and the exact count from their APIs.
For English text with OpenAI tokenizers, a token is about 4 characters or 0.75 words. Code, JSON, URLs and languages that don't use the Latin alphabet take more tokens per word.
Tokens per words and pages
| Text | Words | Characters | Tokens (about) |
|---|---|---|---|
| A tweet-length prompt | 50 | 270 | 70 |
| A short email | 200 | 1,100 | 270 |
| One page, single-spaced | 500 | 2,700 | 670 |
| 1,000 words | 1,000 | 5,300 | 1,300 |
| A blog post | 2,000 | 10,700 | 2,700 |
| A 10-page report | 5,000 | 26,700 | 6,700 |
| A short book chapter | 10,000 | 53,300 | 13,300 |
From the rule of thumb of 0.75 words or 4 characters per token (OpenAI tokenizers, English). Real text varies by 10 to 30% either way; Claude usually counts more.
Count Claude and Gemini tokens exactly
Claude (Anthropic)
POST /v1/messages/count_tokens takes the same body as a Messages request (system prompt, tools, images, PDFs) and returns input_tokens. It is free, with its own rate limit. Anthropic notes the count may differ slightly from the billed number.
curl https://api.anthropic.com/v1/messages/count_tokens \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "content-type: application/json" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "claude-opus-5-5",
"messages": [{"role": "user", "content": "Hello, Claude"}]
}'
# {"input_tokens": ...}Docs: Anthropic token counting
Gemini (Google)
The countTokens method takes the same contents as generateContent and returns totalTokens. Swap in the model you use.
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.8-flash:countTokens" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"contents": [{"parts": [{"text": "The quick brown fox."}]}]}'
# {"totalTokens": ...}More: AI model API pricing · free LLM API keys · AI coding agents · all free developer tools
FAQ
Is this token counter exact?+
For OpenAI models, yes. It runs the same tokenizers OpenAI uses: o200k_base for GPT-4o, GPT-4.1, GPT-5 and the o-series, and cl100k_base for GPT-4 and GPT-3.5. Chat requests add a few tokens per message for roles and formatting, so an API call bills slightly more than the text alone. Claude and Gemini numbers are estimates.
Why is the Claude count only an estimate?+
Anthropic does not publish an offline tokenizer for current Claude models, and Claude splits text differently from GPT. Anthropic says Claude Opus 4.7 and later models use a newer tokenizer that produces about 30% more tokens for the same text than earlier Claude models. For an exact number, call the free count_tokens endpoint with the model you plan to use.
How do I count Gemini tokens exactly?+
Call the Gemini API's countTokens method (POST /v1beta/models/{model}:countTokens) with the same contents you would send to generateContent. It returns totalTokens. Google's docs say a token is about 4 characters and 100 tokens is about 60 to 80 English words.
What is a token?+
A token is a chunk of text the model reads as one unit: a whole common word, part of a longer word, a space plus a word, a number or a punctuation mark. Models read, limit and bill text in tokens, not words or characters.
How many tokens is 1,000 words?+
About 1,300 tokens for typical English with OpenAI tokenizers, using the rule of thumb of 0.75 words per token. Plain, simple prose can come in lower; code, URLs, tables and non-English text come in higher. Paste your own text to get the real number.
Does my text leave the browser?+
No. The tokenizer is downloaded once and runs on your device. The page makes no network requests with your text and does not store it.
Which output token number should I use for cost?+
Use the length of a typical answer. A short reply is 100 to 300 tokens, a page of text is around 700. Reasoning models also bill their hidden thinking tokens as output, so budget more for them.