Ask a person how long a piece of text is and they will count words. Ask a model and it counts something else entirely: tokens. The two numbers sit side by side in writing tools as if they were interchangeable, and they are not. A text that looks modest in words can be heavy in tokens, and the limits and prices that govern AI tools are all written in tokens.

This guide explains what a token is, why the count differs from the word count, and how to measure both with the free Token Counter on Ovatly, which runs a real tokenizer in your browser and shows tokens alongside characters, words, sentences and paragraphs.

Contents

  • Quick answer
  • What a token actually is
  • Why the two counts drift apart
  • How to count tokens, step by step
  • Worked example: three texts, counted exactly
  • Exact for one family, approximate for the rest
  • Limitations and honest expectations
  • Common mistakes
  • Troubleshooting
  • FAQs
  • Conclusion

Quick answer

A token is a sub-word piece of text, the unit models actually read. Frequent words are often one token; unusual words split into several, and punctuation and spaces attach to neighboring tokens. So "Hello, world!" is 2 words but 4 tokens. Paste any text into the Token Counter and it reports the token count together with characters, words, sentences and paragraphs. The count is exact for the GPT-4o family encoding and a close approximation for other model families.

What a token actually is

A tokenizer splits text into pieces before a model sees it. The pieces are not letters and not quite words. They are the chunks that occur often enough in written language to be worth storing as units: whole common words, common word endings, punctuation marks, and fragments of longer words.

This is why tokens refuse to line up with words. A frequent short word tends to survive as a single token. A rare word, a line of code, or text in a non-English language usually takes more tokens per word, because the tokenizer has fewer ready-made chunks for it and falls back on smaller pieces. The split is mechanical and consistent, but it follows frequency in the tokenizer's training data, not the boundaries a reader sees on the page.

Why the two counts drift apart

Three habits of the tokenizer explain most surprises. First, spaces and punctuation are not free: they attach to neighboring tokens, so a short sentence with a comma and an exclamation mark carries more tokens than its word count suggests. Second, vocabulary matters more than length: a paragraph of plain everyday English sits close to one token per word, while technical terms and names push the ratio up. Third, code is expensive in tokens, because symbols, indentation and uncommon identifiers all split into small pieces.

The practical consequence is that rules of thumb fail exactly where you need them most. Estimating tokens from words works passably for ordinary prose and badly for code, tables and multilingual text. When a context limit or a per-token price is at stake, measure instead of estimating.

How to count tokens, step by step

  1. Open the Token Counter and paste or type the text you want to measure.
  2. Click Count tokens.
  3. Read the token count together with the character and word counts, plus the sentence and paragraph counts the tool shows alongside.
  4. If you need fill levels or prices, take the count onward to the Context Window Checker or the Prompt Cost Calculator, which the tool page links as companion tools.

Worked example: three texts, counted exactly

The tool's own examples show the drift clearly. Take the greeting "Hello, world!". It has 2 words, and a reader would call it tiny. Counted exactly, it is 4 tokens, 13 characters, or 12 characters without spaces, in 1 sentence. The comma and the exclamation mark are real tokens, so the token count is double the word count.

Now the pangram "The quick brown fox jumps over the lazy dog". It has 9 words and comes out at exactly 9 tokens, one per word, because every word in it is common. Put the two results together and the lesson is plain: the relationship between words and tokens is a property of the text, not a fixed conversion rate.

A fuller sentence lands in between. "Prompt engineering is the practice of writing instructions for AI models." is 11 words and 12 tokens. Ordinary prose, slightly more tokens than words. That is the normal case, and the greeting and the code-heavy paste are the exceptions at either end.

Exact for one family, approximate for the rest

One honest qualification matters. The counter uses the GPT tokenizer, the o200k encoding of the GPT-4o family, running in your browser through the gpt-tokenizer package. For that family, the count is the exact figure the model itself would use.

Claude, Gemini and other families split text differently, so for them the count is a close approximation, not an exact figure. That is usually enough to judge whether a document fits or what a prompt roughly costs, but the providers' own counters are the authority for their models. If a few tokens either way decide your case, count with the provider's tool before you commit.

Limitations and honest expectations

The counter counts the raw text you paste. Real chat APIs add a few tokens per message for role markers and structure, so treat the result as the content size, not the final API payload. A conversation also spends tokens on the system prompt and the model's reply, neither of which is in your paste.

Very long pastes are counted on your own device, and a full book can take a moment. Nothing is uploaded while that happens: the tokenizer runs in the page, and your text never leaves it. That privacy is worth having, because the texts people most need to count, contracts, drafts and internal documents, are often the ones they least want to send anywhere.

Common mistakes

  • Estimating tokens from words with a fixed ratio. The ratio moves with the text. Common prose sits near one token per word; greetings with punctuation, code and non-English text do not.
  • Forgetting the wrapper. Chat formatting, system prompts and earlier messages all spend tokens too. A paste that fits on its own can still overflow a nearly full conversation.
  • Treating an approximation as exact. For Claude, Gemini and other families this count is close, not exact. Leave headroom, or use the provider's own counter for a final check.
  • Counting the wrong draft. Token counts belong to the exact text. Edit the prompt after counting and the number changes; count the version you will actually send.
  • Ignoring the other measures. The character, word, sentence and paragraph counts sit next to the token count for a reason: together they confirm that a long paste arrived complete and untruncated.

Troubleshooting

The token count is much higher than the word count. Your text likely contains code, rare vocabulary, heavy punctuation or non-English passages, all of which split into more tokens per word. That is the tokenizer working as designed, not an error.

The count differs slightly from my provider's number. Expected, for any family other than GPT-4o. Different tokenizers split differently, and the provider's own counter is the authority for its models.

Counting a very long document seems slow. The counting happens on your device. Give it a few seconds, and keep the tab in the foreground while it works.

FAQs

Why does the token count differ from the word count? Tokenizers split text into sub-word pieces. Frequent words tend to be single tokens, unusual words become several, and punctuation and spaces attach to neighboring tokens.

Is this the exact count for Claude or Gemini? No. It is exact for the GPT-4o family encoding it uses, and an approximation for other families. Providers' own counters are the authority for their models.

Does chat formatting add tokens? Yes, real chat APIs add a few tokens per message for role markers and structure. This tool counts the raw text only, so treat the result as the content size, not the final API payload.

Is my text uploaded for counting? No. The tokenizer runs in your browser; nothing leaves the page.

When should I check the token count instead of the word count? Before pasting a long prompt or document into a model with a context limit or a per-token price. Those limits and prices are set in tokens, so the token count is the number that decides whether the text fits and what it costs.

Conclusion

Words are how people measure text; tokens are how models measure it, and the two counts agree only on the plainest prose. The Token Counter makes the real number visible in seconds, exactly for the GPT-4o family and closely for the rest, without your text leaving the browser. Count before you paste, and limits stop being surprises. A prompt you have counted is also worth keeping tidy for reuse, which is the subject of the companion guide, How to Format a Prompt So It Is Easy to Read and Reuse. For more tools and guides like these, see the AI and Prompt Tools guides.