Home / Free AI Tools / Free GPT Token Counter

Free GPT Token Counter

Count tokens for GPT-4o and newer OpenAI models using the o200k_base tokenizer, with a view of how your text is split.

Seeing how GPT splits your text

A token counter that gives only a number hides the most instructive part. This GPT token counter runs a real tokenizer in your browser, so the count is exact for the encoding it uses, and it can also show you where your text is cut into pieces. Tick Show how the text is split into tokens, and every token is highlighted in its own colour. Suddenly some surprises make sense: why a long unusual word costs several tokens, why a number is chopped up, why a block of code is expensive. Nothing you paste leaves your device.

What the four numbers tell you

  • Tokens: the exact count for the o200k_base encoding.
  • Words: pieces of text separated by spaces, for comparison.
  • Characters: the length of your text including spaces.
  • Characters per token: a quick diagnostic. Plain English prose lands near four. A much lower number means your text is expensive: code, long numbers, emoji, unusual names or scripts that the tokenizer splits into many small pieces.

What you can learn from the split

  • Common English words are often a single token, usually including the space before them.
  • Rare words, names and technical terms break into several pieces.
  • Numbers are chopped into short groups of digits.
  • Punctuation, emoji and symbols can each take a token or more.
  • Scripts such as Bengali or Arabic usually need more tokens per word than English.

Try pasting a sentence in English and its translation, and compare the counts. The difference is often striking. The colour view shows the first 1,500 tokens, which is plenty to study a sample.

Which encoding this counter uses

A tokenizer’s vocabulary is called an encoding, and different generations of OpenAI models use different ones. This tool uses o200k_base, the encoding used by GPT-4o and newer OpenAI models. Older models such as GPT-3.5 and GPT-4 use cl100k_base, so their counts can differ a little, usually by a few percent for English and more for other languages. If you work with an older model, treat the number here as a close estimate. The first count takes a moment longer, because the tokenizer is loaded the first time you use it.

Chat requests have a little overhead

When you call a chat model, each message is wrapped with a few extra tokens that mark who is speaking, and the conversation carries a small fixed overhead. The number of tokens the API reports for a short chat is therefore slightly higher than the count of your text alone. The difference is a handful of tokens per message and rarely matters, but it explains why your own count and your bill can differ by a small amount.

Practical uses

  • Fit a prompt under a limit before you send it.
  • Set a sensible maximum for the reply by knowing the size of what you expect.
  • Estimate cost with the AI API cost calculator.
  • Compare formats: the same data as compact JSON, as a table or as plain sentences may use very different numbers of tokens.
  • Trim the fat: turn on the colour view and see which long passages eat your budget.

Four experiments worth trying

  1. Paste a plain English sentence, then the same sentence in Bengali or another language, and compare tokens and characters per token.
  2. Paste a number such as 1234567890 and see how it is split.
  3. Paste a short piece of code and compare its characters per token with ordinary prose.
  4. Paste the same list in two forms, as sentences and as compact JSON, and see which is cheaper.

Each takes a few seconds, and together they give you a better feeling for what tokens really are than any explanation could.

Exact or estimated?

For models that use o200k_base, the count here is exact for your text. For other model families, such as Claude and Gemini, use their own counters, because their tokenizers differ. The Claude token counter and the general AI token counter give estimates, and the context window checker shows whether your text fits a given model. For billing-accurate numbers, rely on the usage figures that your provider’s API returns.

FAQ

Paste your text above. The tool shows the token count, and you can tick the option to see how the text is split.

o200k_base, which is used by GPT-4o and newer OpenAI models.

Close, but not always exactly. Older models use cl100k_base, so counts can differ a little.

The average number of characters in each token. Plain English is near four. A lower number means text that is more expensive to process.

No. Counting runs in your browser.

Yes. Tick Show how the text is split into tokens. Each token is highlighted, so long or unusual words that split into many pieces stand out.

More free tools

Scroll to Top