Skip to content
Esc

Token counter

Text never leaves this browser

English text is often about 1.3 tokens per word, but the real count depends on the tokenizer. Paste text here: OpenAI totals are an exact o200k_base or cl100k_base count, loaded in this tab. Claude and Gemini are estimates and are marked as estimates. The text never leaves the browser.

This text stays in the tab. The OpenAI tokenizer (about 1 MB or 2 MB) downloads from this site the first time you count; the text is not part of that request.

Characters

0

What you see

Words

0

Split on spaces

Tokens

0

Exact

Show as the token total

Exact count of this text with the o200k_base encoding (GPT-4o, GPT-4.1, GPT-5 and the o-series in the tiktoken model map).

  • OpenAI o200k_base0Exact
  • OpenAI cl100k_base0Exact
  • Claude≈ 0Estimate
  • Gemini≈ 0Estimate

These numbers count the text itself. A chat request adds a few tokens of message framing, and images or files are not included.

How to use it

  1. Paste or type the text. Characters and words update immediately.
  2. Read the OpenAI rows once the tokenizer has loaded. They count this text with o200k_base and cl100k_base.
  3. Use the Claude and Gemini rows only as estimates. Each one is labelled Estimate.

Details

OpenAI
Exact. js-tiktoken, encodings o200k_base (GPT-4o, GPT-4.1, GPT-5, o-series) and cl100k_base (GPT-4, GPT-3.5). Loaded only when you count
Claude
Estimate only. Anthropic has not published the current tokenizer. Characters ÷ 4, with a higher band for models from Opus 4.7
Gemini
Estimate only. About 4 characters per token, from Google's own description. Not the API count
Also shown
Characters (one emoji counts as one) and words (split on whitespace)
Not included
Chat-message framing, images and tool definitions. This is the text itself
Privacy
The text stays in the tab. Only the tokenizer code is downloaded, and only after you paste something

Questions

Does the text leave the browser?

No. Counting runs in this tab. The OpenAI tokenizer is a file of about 1 MB or 2 MB downloaded from this site the first time you count. The text is not part of that request, and nothing is sent to OpenAI, Anthropic or Google.

Why is the Claude count labelled an estimate?

Anthropic has not published the tokenizer used by current Claude models. The old public tokenizer does not match Claude 3 or later. This page shows characters ÷ 4, and a higher figure about 30% above that for models from Claude Opus 4.7, which use a newer tokenizer. Neither number is the count the API would bill.

Why is the Gemini count labelled an estimate?

Google describes a Gemini token as about 4 characters, or about 60–80 English words per 100 tokens. An official in-browser tokenizer exists, but its web build is not complete, so this page does not pretend to run it. The figure is characters ÷ 4 and is not the API count.

Why do the two OpenAI rows differ?

They are different encodings. o200k_base is the encoding for GPT-4o, GPT-4.1, GPT-5 and the o-series in the tiktoken model map. cl100k_base is the encoding for GPT-4 and GPT-3.5. The same sentence can be a different number of tokens. A model on a newer encoding than these two will not match either row.

Does this include the tokens a chat request adds?

No. The count is the encoding of the text you pasted. A chat API adds a few tokens of framing per message, and images, PDFs and tool definitions are extra. For a billing dispute, compare a short English string with the provider's own counter.

Is words × 1.3 exact?

No. It is a rough English average, and it is a poor guide for code, CJK text and emoji. The OpenAI rows are the exact encoding counts. The Claude and Gemini rows use characters ÷ 4 and say they are estimates.