By Plainly Editorial

Updated

Token counter

Count the tokens in any text, see exactly where it splits, and estimate what it will cost to send to an AI model.

Your text stays in your browser. Nothing is sent to a server.

0
Exact count once you type
0
0
–

Estimate the cost

–

Uses standard list prices with no caching or batch discounts. Other providers count tokens differently, so treat non-OpenAI costs as estimates.

How this token counter works

AI language models do not read letters or words. They read tokens: chunks of text from a fixed vocabulary, usually somewhere between a single character and a whole word. Before a model sees your prompt, a tokenizer chops it into those chunks and turns each one into a number.

This page runs OpenAI's open-source o200k_base tokenizer directly in your browser, the same one used by GPT-4o and OpenAI's newer models. That is why the count is exact for those models rather than an estimate. The coloured view shows each token as its own block, so you can see which words stay whole and which get split.

Why Claude, Gemini, and other models give different counts

Every model family trains its own tokenizer with its own vocabulary, so the same paragraph can be a slightly different number of tokens on each. For ordinary English the counts are usually in the same ballpark, which makes this counter a good planning tool for any model. For billing-grade accuracy on another provider, use that provider's own token-counting endpoint.

Differences grow with unusual text. Source code, tables of numbers, URLs, emoji, and languages with non-Latin scripts tend to split into more pieces, and tokenizers disagree more on how to split them.

Token rules of thumb for English text

TextRoughlyApproximate tokens
1 token4 characters or ¾ of a word1
A short sentence15 words20
A paragraph100 words130
A page of prose500 words650–700
1,000 words2 pages1,300–1,400
A long report10,000 words13,000–14,000
A novel90,000 words120,000+

How to cut your token count

  • Trim long chat histories: summarise older turns instead of resending them.
  • Send only the relevant part of a document. Retrieval (RAG) does this automatically.
  • Strip boilerplate such as repeated headers, signatures, and HTML markup.
  • Ask for shorter answers. Output tokens usually cost the most.
  • Use prompt caching if your provider offers it for a long, repeated system prompt.

Common questions

Is this token count exact?

It is exact for OpenAI models that use the o200k_base tokenizer, which covers GPT-4o and OpenAI's newer models. Other providers such as Anthropic and Google use their own tokenizers, so the same text can come out somewhat higher or lower there. For an exact count on another provider, use that provider's token-counting API.

Is my text sent anywhere?

No. The tokenizer downloads to your browser the first time you type, and all counting happens on your device. Nothing you paste is uploaded or stored.

How many tokens is one word?

In typical English prose, one word averages about 1.3 tokens, or put the other way, one token is about three quarters of a word. Short common words are usually one token. Long, rare, or technical words split into several.

Why does code or non-English text use more tokens?

Tokenizers are built from the text they were trained on, which is mostly English prose. Common English words get their own tokens, while code symbols, unusual spacing, and many other languages get broken into smaller pieces, so they need more tokens for the same amount of meaning.

Do output tokens cost the same as input tokens?

Usually not. Most providers charge several times more for each output token than for each input token, because generating text is more work than reading it. That is why the cost estimate asks for an expected output length separately.

Does the system prompt count toward tokens?

Yes. Everything the model reads counts: the system prompt, earlier messages in the conversation, any documents or tool results you include, and the reply it writes. In a long chat, the history is often the biggest share of the bill.

Sources and further reading

  1. What are tokens and how to count them? — OpenAI Help Center
  2. tiktoken: fast BPE tokenizer for OpenAI models — OpenAI on GitHub
  3. Token counting — Anthropic docs

Keep reading