1 MinuteTools

Token counter

Count the tokens in a prompt or document for GPT models.

Your text stays on your device. It is never uploaded.

Paste some text to count its tokens.

  1. 1Paste or open your text
  2. 2Tokens are counted in your browser
  3. 3Compare the counts for different models

Nothing is uploaded. It all stays on your device.

Count the tokens in a prompt or document

Language models read text in tokens, and limits and prices are based on them. Paste a prompt, an article or any text, and this tool shows how many tokens it uses, along with the characters, words and lines.

How to use it

  1. Paste your text, or open a text file.
  2. Read the token counts for the GPT-4o family and for GPT-4.
  3. Use the estimate for other models, and keep in mind that they count differently.

How the counts are made

  • The GPT-4o family count uses the o200k_base tokenizer, and the GPT-4 and GPT-3.5 count uses cl100k_base. These are the real tokenizers, run in your browser.
  • For other models the tool shows an estimate of about one token for every 4 characters of English text.
  • Special markers such as the end-of-text tag are counted as ordinary text.

Ways to use fewer tokens

  • Remove extra spaces, blank lines and repeated instructions.
  • Say things once, and keep instructions short and specific.
  • Send lists of similar records in a compact format. JSON to TOON shows the saving for your data.
  • Send only the part of a document the model needs.

Your data stays private

Your text is processed in your browser. It is never uploaded or stored.

Questions

What is a token?
A token is a small piece of text that a language model reads, such as a word, part of a word, or a punctuation mark. Models read and charge for text in tokens, not in words.
How many tokens is 1,000 words?
For ordinary English, a rough rule is that 1,000 words is about 1,300 to 1,400 tokens. Code, numbers and other languages can use more. Paste your text to get the exact count.
Does Claude or Gemini count tokens the same way?
No. Each company uses its own tokenizer, so the same text gives a different count. This tool gives exact counts for OpenAI tokenizers and a rough estimate for the others.
Which count should I use?
Use the GPT-4o family count for models that use the o200k_base encoding, and the GPT-4 count for models that use cl100k_base. Check your model provider for which one applies.
Is my text uploaded?
No. The text is counted in your browser and never leaves your device.

More calculators

Other free tools