Token Counter

Count GPT-compatible tokens in any text.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

About this tool

Paste text and see its token count, character count and word count update live. Tokens are counted with OpenAI's o200k_base tokenizer, the encoding behind GPT-4o-family models. It runs entirely in your browser and never calls a model or an API.

How to use

1
Step 1
Paste or type your text.
2
Step 2
Read tokens, characters and words as they update.
3
Step 3
Compare with your model's context window.

How it works

Models read text as tokens, which are chunks of characters produced by byte-pair encoding. English prose averages roughly 4 characters or three-quarters of a word per token, while code, numbers and some languages use more tokens per character. Counts here come from the gpt-tokenizer library; special-token text such as <|endoftext|> is counted as ordinary text, and characters are Unicode code points. Other model families (Claude, Gemini, Llama) use different tokenizers, so treat the number as an estimate for them.

Worked example

A short instruction

Input
Summarize the following article in three bullet points.
Output
11 tokens, 55 characters, 8 words
Walkthrough
Eight words become 11 tokens because the final period and some word pieces count separately.

Limitations

  • Exact only for OpenAI models that use o200k_base. Anthropic, Google and open-weight models tokenize differently, usually within a few percent for English.
  • It counts the text you paste, not the hidden tokens that chat formatting, system prompts and tool schemas add.
  • Counts use o200k_base (GPT-4o family). Older OpenAI models use cl100k_base, which usually agrees on English but differs on many non-English texts.
  • No cost calculation.

Questions

How many tokens is my text?
Paste it in and read the token count. As a rough rule, 100 tokens is about 75 English words.
Is my text sent to OpenAI?
No. Counting runs in your browser and nothing is transmitted.
Will this match Claude's token count?
Not exactly. Claude uses a different tokenizer, so use this as an estimate.
Why do tokens differ from words?
Tokens are sub-word pieces. Rare words, numbers, punctuation and non-English text split into more tokens.

Features

  • Live count
  • Tokens, characters, words
  • Local, no API call

Related resources

Guides and videos from around the web—opens on YouTube or the publisher’s site.

  • TensorFlow 2.0 Complete Course

    freeCodeCamp.org

    Practical ML stack context next to AI utilities.

    Watch on YouTube
  • Finding mean, median, and mode

    Khan Academy

    Baseline stats for accuracy and evaluation helpers.

    Watch on YouTube