Token counter for GPT, Claude and Gemini

This token counter shows how many tokens your text uses in GPT, Claude and Gemini models. GPT counts are exact. Claude and Gemini counts are estimates, and the table shows how far off each one ran in our tests. Counting happens in your browser, so your text never leaves this page.

Your text
0
Characters
0
Words
0
GPT-5 and GPT-6 tokens
ModelsTokensHow it is counted
GPT-4o, GPT-4.1, GPT-5 and GPT-60Exact (o200k_base)
GPT-4 and GPT-3.5 Turbo0Exact (cl100k_base)
Claude Opus 4.7, Opus 4.8 and Claude 50Estimate, within 11% on 9 in 10 test texts
Claude 4.5 and 4.60Estimate, within 10% on 9 in 10 test texts
Gemini 40Estimate, within 10% on 9 in 10 test texts
Gemini 2.5 to 3.80Estimate, within 9% on 9 in 10 test texts

Which counts are exact

OpenAI publishes two tokenizers that cover its chat models: o200k_base, which OpenAI lists for GPT-4o, GPT-4.1 and GPT-5, and cl100k_base, used by GPT-4 and GPT-3.5 Turbo. The page runs both with the open-source gpt-tokenizer library. GPT-6 is not on OpenAI's list yet, so we checked it: on 53 test texts, the o200k_base count matched the prompt tokens OpenAI reported for GPT-6 and GPT-6.2 every time.

How the Claude and Gemini estimates work

A Claude token counter that runs in the browser can only estimate, because Anthropic does not publish the tokenizer for its current models, and neither does Google for Gemini. Their counting APIs give exact numbers, but they need an API key, and your text would have to leave the browser. So the page counts GPT tokens first, sorts them by what they hold (short and long English words, digits, punctuation, Chinese characters, Japanese kana, Cyrillic, Arabic and so on) and multiplies each kind by a weight fitted to that provider's own counts.

We fitted the weights on 125 text excerpts and tested them on 64 others. They cover prose in 21 languages, English articles and software licences, code in TypeScript, Python, Go and Rust, Markdown, JSON, CSV and chat messages full of emoji. On the test excerpts:

ModelsAverage error9 in 10 texts within
Claude Opus 4.7, 4.8 and Claude 56.1%10.4%
Claude 4.5 and 4.65.3%9.7%
Gemini 44.0%9.1%
Gemini 2.5 to 3.83.8%8.3%

The worst misses were a React component, where the Claude 5 estimate came out 32% high, and a block of short German interface strings, where it came out 22% low. When you need an exact Claude or Gemini number, for a budget or an invoice check, use the provider's counting API.

Claude 5 uses more tokens than Claude 4.5 for the same text

Claude changed tokenizers with Opus 4.7. We sent the same texts to Anthropic's token counting API for both generations:

TextOpus 4.7, 4.8 and Claude 5Claude 4.5 and 4.6
English paragraph, 754 characters211163
Python script, 725 characters303233
Markdown checklist, 500 characters198145

That is 29% to 37% more tokens on these three, which is worth knowing before you compare per-token prices across the two generations. Japanese and Chinese paragraphs came out within one token of each other on both.

Why the same text gets different counts

Each tokenizer learned its own vocabulary, so each one splits text in its own way. Some results from our test texts:

TextGPT-5 and GPT-6Claude 5Gemini 2.5 to 3.8Gemini 4
English paragraph, 754 characters159211161161
Python script, 725 characters197303229221
Daily sales as CSV, 322 characters171187263263
Japanese paragraph, 114 characters881055958

Gemini spends more on numbers: the CSV of daily sales cost it 263 tokens against GPT's 171. Japanese went the other way: Gemini 2.5 to 3.8 used 59 tokens and Gemini 4 used 58, where GPT needed 88. If your prompts are mostly figures or mostly one language, count a real sample before you pick a model on price.

Your text stays on your device

The counter runs in a background thread in your browser. The first time you type, the page downloads the two GPT vocabularies from neotask.ai. After that it makes no network requests while you count, and nothing you paste is stored or sent to us or to any model provider.

Questions

How many tokens is a word?
For English, about 1.1 tokens per word in GPT and Gemini and 1.5 in Claude 5. Our 143-word test paragraph came to 159 tokens in GPT-5 and GPT-6, 161 in Gemini and 211 in Claude 5. Other languages and code use more.
Why does the API report more tokens than this counter?
The counter counts your text alone. An API request also carries message formatting, the system prompt, tool definitions and earlier turns. A one-letter message counts as 9 input tokens on Claude Opus 5.5 and 7 prompt tokens on GPT-6.
Which Claude models share a tokenizer?
Claude Opus 4.8 and every Claude 5 model we tried (Opus 5 and 5.5, Sonnet 5 and 5.5, Haiku 5.5, Fable 5, 5.1 and 5.2) returned identical counts on our test texts, and Opus 4.7 was one token apart on one of nine. Opus 4.5, Opus 4.6, Sonnet 4.5, Sonnet 4.6 and Haiku 4.5 share a second tokenizer that produces fewer tokens for English and code.
Can it count tokens in a PDF or an image?
No. It counts plain text. Copy the text out of a document and paste it in. Model providers count an image by its dimensions, not by any text inside it.
Is it free?
Yes. There is no sign-up and no limit beyond what your browser can hold.

See the tokens every agent run usesIn Neotask, agents run on Claude, GPT and Gemini models, and the Sessions page lists each run's model with its input, output and cache tokens.

Download Neotask