AI Token Counter

Paste text to see an exact OpenAI token count, Claude and Gemini estimates, and what it costs to send.

0OpenAI tokens (exact)
0characters
0words
~0Claude tokens (estimate)
~0Gemini tokens (estimate)

Loading the tokenizer…

What would this text cost as input?

ModelTokensInput costPer 1M in / out
GPT-6.2 Astrao200k_base, best match~0~$0$8 / $40
GPT-6.2 Solo200k_base, best match~0~$0$2 / $10
GPT-6.1 Terrao200k_base, best match~0~$0$1 / $5
GPT-6 Lunao200k_base, best match~0~$0$0.1 / $0.5
GPT-5.5exact0$0$5 / $30
GPT-4.1exact0$0$2 / $8
GPT-4o miniexact0$0$0.15 / $0.6
Claude Fable 5.2estimate~0~$0$8 / $40
Claude Opus 5.5estimate~0~$0$4 / $20
Claude Sonnet 5.5estimate~0~$0$2 / $10
Claude Haiku 5.5estimate~0~$0$0.1 / $0.5
Gemini 4 Carbonestimate~0~$0$4 / $20
Gemini 4 Neonestimate~0~$0$3 / $15
Gemini 4 Hydrogenestimate~0~$0$1.5 / $7.5

Prices checked December 2026 from OpenAI, Anthropic and Google. Standard rates, short context, no caching or batch discount. Rows marked ~ use an estimated token count. Claude Haiku 5.5 is the under-100K-token price.

What is a token, and how many tokens is my text?

A token is the chunk of text a language model reads and bills by. It is often a whole short word, part of a longer word, a space plus a word, or a single punctuation mark. In English, one token is about 4 characters or three quarters of a word.

Models do not read letters or words. They read a sequence of numbered chunks from a fixed vocabulary, built by an algorithm called byte-pair encoding. Your prompt, the documents you attach and the answer you get back are all measured in these chunks. They set how much fits in the context window and how much a request costs.

How do I count tokens with this tool?

  1. Paste or type into the box. The count updates as you type, and the example is already filled in.
  2. Pick the OpenAI encoding that matches your model. Use o200k_base for GPT-4o, GPT-4.1, GPT-5 and the o-series. Use cl100k_base for GPT-4, GPT-4 Turbo and GPT-3.5.
  3. Read the OpenAI count, then the Claude and Gemini estimates, which carry a ~ and the word estimate.
  4. Press Show tokens to see each token as a colored block. Odd splits show you where your text is expensive.
  5. Check the cost table, then press Copy counts to paste the numbers into a ticket or a doc.

How accurate is each count?

Only one of the three vendors lets this tool match billing, so the labels matter.

FamilyMethod hereAccuracy
GPT-4o, GPT-4.1, GPT-5, o-serieso200k_base byte-pair encoding, run in your browserExact for the text. Chat formatting adds a few tokens per message.
GPT-4, GPT-3.5cl100k_base byte-pair encodingExact for the text.
GPT-6 familyo200k_baseClosest public tokenizer. OpenAI's model pages do not name the GPT-6 tokenizer, so this is a best match, not a guarantee.
Claudeo200k_base count times 1.2, shown as an estimateRough. Plausible range is 1.0 to 1.4 times the o200k count. The multiplier is this tool's heuristic, not a figure Anthropic publishes.
Geminio200k_base count, shown as an estimateRough, about plus or minus 10 to 15 percent for English. Google gives the same 4 characters per token guidance as OpenAI.

For a billing-grade Claude number, call Anthropic's token counting endpoint. For Gemini, use countTokens from the Gemini API token guide. Both take the model name, so they count with the tokenizer you will actually be billed on. Anthropic notes that its Claude 4.7 and later models produce roughly 30 percent more tokens for the same text than earlier ones, which is why one multiplier cannot cover every Claude model.

How many characters or words is one token?

OpenAI's help center gives three English rules of thumb (checked December 2026): 1 token is about 4 characters, 1 token is about three quarters of a word, and 100 tokens are about 75 words. Google's Gemini guide also says a token is about 4 characters, with 100 tokens equal to roughly 60 to 80 English words. These are averages. OpenAI says other languages have different relationships between characters, words and tokens, so do not apply the English ratios to them.

A quick check with this tool: "The quick brown fox jumps over the lazy dog." is 44 characters and 9 words, and it is 10 tokens in both encodings, or 4.4 characters per token.

Why do other languages and code use more tokens?

A tokenizer learns its vocabulary from training text, so strings it saw often become single tokens and rare strings are split into pieces. English prose fits well. Many other scripts, numbers and symbols do not. These counts come from this tool:

TextCharacterso200k_basecl100k_base
The quick brown fox jumps over the lazy dog.441010
El rápido zorro marrón salta sobre el perro perezoso.531517
素早い茶色の狐が怠け者の犬を飛び越える。202030
तेज़ भूरी लोमड़ी आलसी कुत्ते के ऊपर कूदती है।452049
function add(a, b) { return a + b; }361313
😀😀😀😀😀5510

The Hindi sentence needs more than twice the tokens in cl100k_base as in o200k_base. The newer encoding has a vocabulary of roughly 200,000 entries against roughly 100,000, so it holds longer chunks of non-English text. If your users write in several languages, count a sample from each one.

How big is each model's context window?

The context window is the most tokens a request can hold, counting your input and the model's output together. Figures come from OpenAI's model list, Anthropic's context window page and Google's model list (checked December 2026).

ModelContext windowMax output
GPT-6.2 Astra, GPT-6.2 Sol, GPT-6.1 Terra, GPT-6 Luna1.05M tokens128K
Claude Fable 5.2, Opus 5.5, Sonnet 5.5, Haiku 5.51M tokens128K per request
Gemini 4 Carbon, Neon, Hydrogen1M tokensListed by Google as "64K / 1M"; check the model page for which applies

Claude Haiku 5.5 charges higher prices once a prompt passes 100,000 tokens, and OpenAI's GPT-5.5 does the same past 272K, so a long prompt can cost more per token as well as use more of them. The table leaves out older GPT-5.x, GPT-4.1 and GPT-4o models, so check their model pages if you rely on those.

How do I cut the number of tokens?

Which encoding does each OpenAI model use?

EncodingModelsNotes
o200k_baseGPT-4o, GPT-4.1, GPT-5, o1, o3, o4-miniDefault for current models in the open-source tokenizer libraries.
cl100k_baseGPT-4, GPT-4 Turbo, GPT-3.5 Turbo, text-embedding-3Older models. Needs more tokens for many non-English scripts.

OpenAI's own cookbook lists o200k_base for only gpt-4o and gpt-4o-mini, so the GPT-4.1, GPT-5 and o-series mapping comes from the open-source tokenizer libraries (tiktoken ports, and the gpt-tokenizer package this page runs) rather than an OpenAI table. It is the standard assumption, but it is a mapping you should be aware of.

Frequently asked questions

How many tokens is 1,000 words?

About 1,300 tokens in English, using OpenAI's rule that 100 tokens are roughly 75 words. Code, numbers and non-English text usually take more tokens per word, so paste your own text for a real count.

Is this token counter exact?

For OpenAI models whose tokenizer is public, yes: the count is the real byte-pair encoding result for o200k_base or cl100k_base. Claude and Gemini counts are estimates, because neither company publishes an offline tokenizer for its current models. The newest GPT-6 models use a tokenizer OpenAI has not documented, so treat o200k_base as the closest match there.

How do I get the exact Claude token count?

Call Anthropic's token counting endpoint with the model you plan to use. It is free to use, rate limited, and still described by Anthropic as an estimate that can differ slightly from billing.

How do I get the exact Gemini token count?

Use the countTokens method in the Gemini API token guide. It counts the input for a specific model before you send the request.

Do spaces and punctuation count as tokens?

Yes, they are part of the text, but they are usually merged into neighbouring tokens. A leading space is normally attached to the word after it, so " world" is one token, not two. Line breaks and repeated spaces can add extra tokens.

Why does the same text have different counts in different models?

Each model family has its own tokenizer with its own vocabulary. A larger vocabulary can hold longer chunks, so o200k_base usually needs fewer tokens than cl100k_base for non-English text. Anthropic also says its newer tokenizer produces roughly 30 percent more tokens than older Claude models for the same text.

Is my text uploaded anywhere?

No. The tokenizer runs in your browser. Nothing you paste is sent to a server, which makes the tool safe for private drafts and internal prompts.

What is the difference between input and output tokens?

Input tokens are what you send, output tokens are what the model writes back. Providers price them separately, and output is several times more expensive per token. This tool prices only the input side, because you cannot know the output length in advance.

More free tools