Direct answer
Paste text to count its tokens for OpenAI, Claude, and Gemini
A token is the unit a model reads and bills. English prose averages about 4 characters per token, but every model family splits text differently. This counter gives an exact count with OpenAI's o200k_base encoding, and a labelled range for Claude and Gemini, whose tokenizers are not public. It also shows what the text costs at current list prices and how much of a 200K or 1M context window it fills. Your text never leaves this browser tab.
Count tokens in your text
Paste or type text, or open a local file. Counts update as you type. Your text never leaves this browser tab.
Your text never leaves this browser tab. Files are read with your browser's FileReader, and counting runs locally.
OpenAI tokens · o200k_base
0
Type or paste text to load the tokenizer.
Claude 4.7+ tokens · estimate
0
Midpoint 0: o200k count × 1.30, from Anthropic's "about 30% more tokens" note. Exact count: Anthropic's token-counting API.
Gemini tokens · estimate
0
Midpoint 0: Google's "about 4 characters per token" rule. Exact count: the Gemini API countTokens method.
Characters
0
Words
0
Lines
0
What this text costs
Standard API list prices per 1M tokens, checked November 8, 2026. OpenAI rows use the o200k_base count; Claude and Gemini rows use the estimate midpoint. Output assumes a short prompt.
| Model | $/M in · out | As input | As output |
|---|---|---|---|
| Claude Opus 5.5 | $4 · $20 | $0 | $0 |
| Claude Sonnet 5.5 | $2 · $10 | $0 | $0 |
| Claude Haiku 5.5Higher rates for prompts over 100,000 tokens. | $0.10 · $0.50 | $0 | $0 |
| GPT-6.1 SolLong-context rates above 272K input tokens. | $2 · $10 | $0 | $0 |
| GPT-6 LunaLong-context rates above 272K input tokens. | $0.10 · $0.50 | $0 | $0 |
| Gemini 3.1 Pro PreviewPreview model. Higher rates for prompts over 200K tokens. | $2 · $12 | $0 | $0 |
| Gemini 3.8 FlashListed rate through December 31, 2026; $1.50 / $7.50 from January 1, 2027. | $0.75 · $3.75 | $0 | $0 |
Context window fill
Share of a window this text takes before system prompts, tools, history, and the reply.
200K tokens
1M tokens
Method
How tokens are counted
A tokenizer splits text into pieces from a fixed vocabulary. Common words are usually one token; rare words, long numbers, punctuation runs, and code symbols are split into several. o200k_base is the byte-pair encoding OpenAI's tiktoken library assigns to GPT-4o, GPT-4.1, the o-series, and gpt-5 models. This page runs a pure JavaScript port of it in your browser, so the OpenAI number is a real count. The other two figures are derived from it:
Tokenizer differences
Why the same text gets three different counts
Token counts are not portable between vendors, or even between generations from one vendor. Count against the model you will actually call.
OpenAI: o200k_base
Public and reproducible. OpenAI's tiktoken maps GPT-4o, GPT-4.1, the o-series, and gpt-5 models to o200k_base; it lists no GPT-6 entry, so newer models may differ. For an exact count on any current model, call POST /responses/input_tokens.
Claude: unpublished, and it changed
Anthropic says Claude 4.7 and later models use a newer tokenizer that produces about 30% more tokens for the same text, and that Claude Sonnet 4.6 and earlier use the previous one. Do not reuse counts measured on older Claude models. The free count_tokens endpoint counts under the model you name.
Gemini: unpublished
Google documents a rule of thumb of about 4 characters per token, or 60 to 80 English words per 100 tokens. The Gemini API's countTokens method returns the exact input count, and each response's usage field reports input, output, thinking, and cached tokens.
Example · prices checked November 8, 2026
Worked scenario: a design doc pasted as context
Example input: a 41,000-character design document that the counter reports as 10,000 o200k_base tokens. The Claude midpoint is 10,000 × 1.30 = 13,000 tokens (range 11,500 to 14,500). The Gemini midpoint is 41,000 ÷ 4 = 10,250 tokens (range 9,000 to 11,275).
| Model | Tokens used | $/M in · out | As input | As output |
|---|---|---|---|---|
| GPT-6.1 Sol | 10,000 | $2 · $10 | $0.0200 | $0.1000 |
| Claude Opus 5.5 | ≈13,000 | $4 · $20 | $0.0520 | $0.2600 |
| Claude Sonnet 5.5 | ≈13,000 | $2 · $10 | $0.0260 | $0.1300 |
| Gemini 3.1 Pro Preview | ≈10,250 | $2 · $12 | $0.0205 | $0.1230 |
200K window, Claude high end
14,500 = 7.25%
1M window, Claude high end
1.45%
Same doc as input, 100 Opus 5.5 calls
≈ $5.20
The single document is cheap; resending it on every turn is what adds up. For repeated context, see prompt caching, which these list prices do not include.
Frequently asked questions
How accurate is this token counter?
The OpenAI figure is an exact o200k_base count of the raw text, produced by the same encoding OpenAI's tiktoken library uses. A real API request adds a few tokens for message formatting, plus anything else you send, such as system prompts and tool definitions. The Claude and Gemini figures are estimates: neither company publishes its tokenizer, so this page shows a range, not a count.
Why does Claude use more tokens than GPT for the same text?
Every model family splits text with its own vocabulary. Anthropic says Claude 4.7 and later models, which include the current Opus, Sonnet, and Haiku 5.5, use a newer tokenizer that produces about 30% more tokens for the same text than earlier Claude models, and that the exact increase depends on the content. Billing and context limits use those larger counts, so the same prompt can cost more tokens on Claude than on an OpenAI model.
How do I get an exact Claude token count?
Send the request to Anthropic's token-counting endpoint, POST /v1/messages/count_tokens, with the model ID you plan to use. It accepts the same system prompt, messages, tools, images, and PDFs as the Messages API and returns input_tokens. Anthropic says it is free to use, subject to per-minute rate limits, and that the result is itself an estimate that can differ from the billed count by a small amount.
Do GPT-6 models use o200k_base?
OpenAI has not published that. As of November 8, 2026, OpenAI's tiktoken library maps GPT-4o, GPT-4.1, the o-series, and gpt-5 model names to o200k_base, and it has no GPT-6 entry. Treat the o200k_base count as exact for those older models and as a close guide for GPT-6.x. For an exact GPT-6.x count, call OpenAI's POST /responses/input_tokens endpoint with the model you use.
How many words is 1,000 tokens?
Google's Gemini documentation gives about 4 characters per token and 60 to 80 English words per 100 tokens, so 1,000 tokens is roughly 600 to 800 words of English prose. Code, JSON, numbers, and non-Latin scripts usually produce more tokens per word. Paste your own text above instead of relying on the ratio.
Is my text sent anywhere?
No. Your text never leaves this browser tab. The tokenizer code is downloaded from this site the first time you type, but your text is never sent with it. Files are read with the browser's FileReader, and every count and cost is computed locally. To measure tokens your coding agents already used, the whoburnedmore CLI command npx whoburnedmore --local reads supported local logs and writes an offline dashboard without uploading anything.
Sources checked November 8, 2026. Prices are standard-tier API list prices in USD and exclude caching, batch, regional, and fast-mode adjustments.
Sources
- Anthropic token counting documentation
Checked November 8, 2026. The free /v1/messages/count_tokens endpoint gives Claude counts; Claude 4.7 and later produce about 30% more tokens than earlier models.
- Anthropic API pricing
Checked November 8, 2026. Claude Opus 5.5, Sonnet 5.5, and Haiku 5.5 list prices, Haiku 5.5's over-100K prompt rates, and the tokenizer note.
- OpenAI API pricing
Checked November 8, 2026. GPT-6.1 Sol and GPT-6 Luna standard and above-272K rates.
- OpenAI tiktoken model-to-encoding map
Checked November 8, 2026. Maps GPT-4o, GPT-4.1, the o-series, and gpt-5 model names to o200k_base; it lists no GPT-6 entry.
- OpenAI input token count endpoint
Checked November 8, 2026. POST /responses/input_tokens returns the input token count for a request to the model you name.
- Google Gemini token guide
Checked November 8, 2026. A Gemini token is about 4 characters; countTokens returns exact input counts.
- Google Gemini API pricing
Checked November 8, 2026. Gemini 3.1 Pro Preview and Gemini 3.8 Flash standard text prices and thresholds.
- gpt-tokenizer (MIT)
Pure JavaScript port of OpenAI's encodings, used to run o200k_base in the browser.