Skip to content

Token Calculator

Illustration for Token Counter

Token Calculator

Estimated tokens
0
Fast mode = quick estimate.
Heuristic mode = closer to actual AI model tokenization, still approximate.

What a token is

Large language models (LLMs) don't read whole words. They split text into tokens: whole words, parts of words, spaces or punctuation. As a rough rule, one token is about four characters of English text, or about three-quarters of a word.

How this counter works

  • Approximate mode divides the number of characters by 4. It is quick and good enough for most planning.
  • Heuristic mode counts word by word: short words count as one token, and longer words count as one token per four characters. It usually lands closer to real counts for normal prose.

Both are estimates. Every model has its own tokenizer, so the exact count differs between models. Code, numbers and non-English text often use more tokens than you would expect. For an exact count, use your model provider's own tokenizer or token-counting API.

Worked example

"Hello world" has 11 characters, so approximate mode gives 11 ÷ 4 ≈ 3 tokens. Many tokenizers count it as 2 tokens ("Hello" and " world").

Why token counts matter

  • Cost: API providers charge per token, for both your input and the model's output.
  • Context limits: every model can only handle a set number of tokens at once. Long documents may need to be split.
  • Speed: more output tokens means a longer wait for the answer.

Learn more in Tokens and context windows in LLMs.

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

One short email when a new calculator or article goes live. No spam, and you can unsubscribe in one click.