AI Token Counter

Count how many tokens a piece of text takes up, so you can plan prompts and stay within context limits. The count is calculated with the GPT-2/GPT-3 byte-pair encoding (BPE) tokenizer and updates as you type. Your text is sent to the quto.dev server to be counted.

How to use

  1. Paste or type your text into the box, replacing the sample sentence that is filled in on load.
  2. Read the Token Count below the box; it updates automatically whenever the text changes.
  3. Click Copy to copy the result as a line such as Token Count: 10.
  4. Click Share to save the text and copy a link that opens the tool with the same text and count.

Example

Input

The quick brown fox jumps over the lazy dog.

Output

Token Count: 10

Frequently asked questions

Which tokenizer does the counter use?

It uses the gpt-3-encoder library, which implements the byte-pair encoding used by GPT-2 and the original GPT-3 models (the r50k_base vocabulary). Newer models such as GPT-4o or Claude use different tokenizers, so for them treat the number as an estimate rather than an exact count.

Is my text sent anywhere?

Yes. Each time the text changes it is sent to the quto.dev API, which runs the tokenizer and returns the count. The text is only stored if you click Share, which saves it so the shared link can load it.

Why does text in other languages use more tokens?

The vocabulary is built mostly from English, so other languages and non-Latin scripts are split into smaller pieces. The English sentence above is 10 tokens, while its Spanish version El rápido zorro marrón salta sobre el perro perezoso. is 23.

Do spaces and line breaks count as tokens?

Yes. Whitespace is part of the text that gets encoded, so extra spaces and blank lines add tokens. Only an empty box, or one containing nothing but whitespace, shows a Token Count of 0.

Related tools