Token Counter

Share:

Count exact GPT/ChatGPT tokens with tiktoken (cl100k & o200k), plus characters, words and Claude/Gemini estimates. Free, accurate, runs in your browser.

RT-AI-001 · AI Tools
Your browser is too old for this tool’s interactive features. Please update to Safari 13.1, Chrome or Edge 80, Firefox 74 or newer.

Token Counter

0 GPT tokens tiktoken
0 Claude 4.7 and later estimate · newer tokenizer
0 Claude before 4.7 estimate · Sonnet 4.6 and earlier
0 Gemini estimate
0 Words  
0 Characters  

GPT counts are exact (OpenAI's tiktoken, cl100k/o200k). Claude and Gemini numbers are estimates — neither tokenizer runs in a browser. Claude uses Anthropic's own published figures: about 3.5 English characters per token on models before Claude 4.7, and about 30% more tokens for the same text on Claude 4.7 and later, which use a newer tokenizer (Anthropic glossary). Anthropic gives no figure for Chinese, Japanese, Korean or Thai, so those characters are counted at OpenAI's rates and the page says when that happens. The Gemini estimate is calibrated per writing system against Google's own token counter and set never to come out below it. Use them as a guide, not a billing figure.

Advertisement
After tool · AD-W1Responsive · Post-tool

How to Use the Token Counter

Pick the model encoding

Choose o200k_base for GPT-5, GPT-4o and GPT-4.1, or cl100k_base for GPT-4, GPT-3.5 and the embedding models. The encoding determines exactly how text is split into tokens.

Paste your text

Type or paste any prompt, document or code. The token, word and character counts update live as you edit — the exact GPT tokenizer runs entirely in your browser.

Read the counts

The headline number is the exact GPT token count. Alongside it you get Claude estimates for both of Anthropic's tokenizers — Claude 4.7 and later, and the models before 4.7 — a Gemini estimate, and word and character totals, so you can size a prompt at a glance.

Check it fits the context window

Compare the token count against your model's context window and leave room for the response. Trim or chunk long inputs before sending to avoid truncation or higher costs.

Advertisement
After how-to · AD-W2Responsive

Tokens: The Unit LLMs Actually Read and Bill

Why tokens, not words, are what matter

Large language models don't read words or characters — they read tokens, chunks of text produced by a tokenizer. A token is often a whole common word, but longer or rarer words split into several pieces, and spaces and punctuation count too. Measured on this site's own English pages, OpenAI's tokenizers average about 4.8 characters per token, or 0.79 words per token (1.27 tokens per word) — so 1,000 tokens is roughly 780 words. But that's only an average; the only way to know the real count is to run the actual tokenizer, which is exactly what this tool does for GPT models using OpenAI's open-source tiktoken encodings.

Tokens are also the unit you are billed in and the unit that fills the context window. Every API call is priced per input and output token, and every model has a hard ceiling on how many tokens a single request can hold. Underestimate and your prompt gets truncated or rejected; overestimate and you pay for headroom you don't need. Counting tokens before you send is how you keep prompts inside the window, control cost, and design reliable chunking for long documents.

"Words are how you write the prompt. Tokens are how the model reads it — and how you pay for it."

Different models, different tokenizers

There is no single universal tokenizer. OpenAI's newer models (GPT-5, GPT-4o, GPT-4.1) use the o200k_base encoding, while GPT-4 and GPT-3.5 use cl100k_base — the same text can produce slightly different counts under each. Anthropic's Claude and Google's Gemini use their own tokenizers, which are not published as browser libraries, so for those this tool shows a clearly-labelled estimate rather than pretending to an exactness it can't deliver. The estimate counts each writing system at its own rate, because a Chinese character costs several times what a Latin letter does. For Gemini the rates were fitted to Google's own counting endpoint on the same text in eight languages (October 2026). For Claude the tool uses Anthropic's published figures, and there are two because Claude has two tokenizers: on models before Claude 4.7 a token is about 3.5 English characters, and Claude 4.7 and later produce about 30% more tokens for the same text. The same English prompt therefore counts higher on a current Claude model than on an older one, and both count higher than on GPT. For GPT models the count here is the genuine article, computed locally from the same encoding tables the API uses. Pick your encoding, paste your text, and size your prompt with confidence.

A thousand tokens is about 780 words, and a leading space changes one

01

A token is a chunk of text — often a whole word, but longer words split into several pieces.

02

On this site's English pages OpenAI's tokenizers average about 4.8 characters per token — 0.79 words per token.

03

So 1,000 tokens ≈ 780 words of English — handy for sizing a prompt quickly.

04

OpenAI's tokenizer is called tiktoken, and it is open source — this tool runs it locally.

05

GPT-5, GPT-4o and GPT-4.1 use the o200k_base encoding; GPT-4 and GPT-3.5 use cl100k_base.

06

You are billed per token — both the tokens you send and the tokens the model generates.

07

The context window is measured in tokens; exceed it and your input is truncated or rejected.

08

Spaces and punctuation are tokens too — and a leading space changes how a word is tokenised.

09

Other languages and code tokenise differently — non-English text often uses more tokens per word.

10

This counter runs entirely in your browser — your text is never sent to any server or model.

📅 Research current as of 21 Oct 2026 · Sources: GPT counts: OpenAI's tiktoken encodings (o200k_base, cl100k_base) via js-tiktoken, with the model-to-encoding map from tiktoken's model.py. Gemini: per-script estimate fitted to Google's countTokens endpoint (gemini-3.8-flash) on this site's about page in eight languages. Claude: Anthropic's glossary and pricing pages — about 3.5 English characters per token before Claude 4.7, about 30% more tokens on Claude 4.7 and later (fetched 2026-10-21); Chinese, Japanese, Korean and Thai on OpenAI's o200k rates, as Anthropic publishes no figure for them. Words per token measured on the English about page, 2026-10-14.
Standards, published formulas, and reference data are revised over time — check against a current authoritative source before relying on these figures.

Frequently Asked Questions

  • A token is the unit of text a language model actually reads. The tokenizer splits your text into tokens — often a whole common word, but longer or rarer words break into several pieces, and spaces and punctuation count too. Models are priced and limited by tokens, not words.
  • For GPT models the count is exact — it runs OpenAI's own tiktoken encodings (cl100k_base and o200k_base) in your browser, the same tables the API uses. The Claude and Gemini figures are clearly-labelled estimates, because those vendors don't publish a browser tokenizer. Gemini is calibrated against Google's own counter; Claude follows Anthropic's published characters-per-token figures, which Anthropic itself calls approximate.
  • Use o200k_base for GPT-5, GPT-4o and GPT-4.1. Use cl100k_base for GPT-4, GPT-3.5-Turbo and the text-embedding models. The same text can produce slightly different counts under each, so match the encoding to the model you'll actually call.
  • Anthropic and Google use their own tokenizers, and unlike OpenAI's tiktoken these aren't released as a library you can run locally in a browser. Rather than show a falsely precise number, we estimate from the characters in each writing system and label it. The Gemini rates were fitted to Google's own token counter. The Claude estimates use Anthropic's glossary: about 3.5 English characters per token before Claude 4.7, and about 30% more tokens on 4.7 and later; for Chinese, Japanese, Korean and Thai, where Anthropic publishes no figure, they fall back to OpenAI's rates and the page tells you. For exact Claude or Gemini counts, use those providers' official token-counting endpoints.
  • Because Claude has two tokenizers. Anthropic says Claude 4.7 and later models use a newer tokenizer that produces about 30% more tokens for the same text than earlier models, and that Claude Sonnet 4.6 and earlier use the previous one. Read the card for the model you will call: the same English paragraph that is 100 tokens on an older Claude is about 130 on Claude 4.7 or later. Anthropic's own advice is to recount prompts on the model you plan to use rather than reuse an older count.
  • Roughly 780 words of English: on this site's English pages OpenAI's tokenizers average 0.79 words per token (1.27 tokens per word), or about 4.8 characters per token. It varies with punctuation, formatting and language — code and non-English text often use more tokens — so treat it as a guideline and count the real text when it matters.
  • No. The tokenizer runs entirely in your browser with a locally-served library. Your text is never uploaded to any server, model, or third party, and nothing is stored. The only network request is your browser fetching the tokenizer file from our own domain.
  • The exact tokenizer table is loaded on first use to keep the page fast. While it loads you'll briefly see an estimate, then the exact GPT count snaps in. After that first load it's instant for the rest of your session.
  • Yes. API pricing is per token for both the prompt you send (input) and the text the model generates (output), and output is usually priced higher. This tool counts the text you paste; to estimate a full request's cost, pair it with our LLM Cost Calculator.
  • Yes — paste code just like any other text. Note that code often tokenises less efficiently than prose because of symbols, indentation and identifiers, so a block of code can use more tokens than the same number of characters of English.
  • Completely free, with no account or sign-up, and no limit on use. It runs in your browser and collects no data.

Method & sources

How it computes

GPT: exact, OpenAI tiktoken run in the browser (o200k_base: GPT-5, GPT-4.1, GPT-4o; cl100k_base: GPT-4, GPT-3.5, embeddings). Claude and Gemini: estimates = Σ characters per script ÷ that script's characters per token. Claude: Anthropic's 3.5 English characters per token before 4.7, ×1.3 tokens on 4.7 and later; Han, kana, Hangul, Thai on OpenAI o200k rates. Gemini: fitted to Google countTokens (TokenEstimateKernel).

What this tool implements

  • The GPT count is exact: the page runs OpenAI's own tiktoken rank tables (vendored js-tiktoken, same-origin), and the model-to-encoding choices follow tiktoken's model.py (gpt-5, gpt-4.1, gpt-4o → o200k_base; gpt-4, gpt-3.5 → cl100k_base).
  • Claude and Gemini are estimates and are labelled so. They count each writing system at its own rate, because characters per token differ several-fold between Latin, Thai, Hangul, kana and Han text; a single English-calibrated divisor under-counted Chinese about 2.8×.
  • Claude follows Anthropic's published figures and shows both tokenizer families: about 3.5 English characters per token on models before Claude 4.7 (Claude Sonnet 4.6 and earlier use the previous tokenizer), and about 30% more tokens for the same text on Claude 4.7 and later. Anthropic publishes no figure for Chinese, Japanese, Korean or Thai; those characters are counted at OpenAI's o200k rates (× 1.3 on 4.7 and later) and the page tells the reader when a text contains them.
  • Gemini calibration corpus: the site's about page in eight languages (en, id, ms, th, ko, zh-CN, ja, zh-TW), measured 2026-10-14 against Google's countTokens endpoint with gemini-3.8-flash; rates are the weighted least-squares fit divided by 1.06, the smallest margin at which no language is under-counted (the estimate runs 1–13% high).
  • The rule of thumb on the page is measured, not quoted: on the English about page OpenAI's tokenizers average 4.8 characters, 0.79 words, per token (1.27 tokens per word).
  • The Token Counter and the Tokens ↔ Words ↔ Characters converter read the same Claude rates from one kernel and give the same count for the same English text on both Claude families.

Sources

What can make this go out of date

  • None at runtime beyond the page's own vendored tokenizer tables; nothing the reader types is sent anywhere.

Abridged — the full review record for this tool runs longer than the list above.

Advertisement
Pre-footer · AD-W3 728 × 90