Token Counter
Count GPT-compatible tokens in any text.
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
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?
Is my text sent to OpenAI?
Will this match Claude's token count?
Why do tokens differ from words?
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 YouTubeFinding mean, median, and mode
Khan Academy
Baseline stats for accuracy and evaluation helpers.
Watch on YouTube
- Machine Learning Crash Course
Google Developers
Official ML crash course pairing with metric calculators.
- Metrics and scoring
scikit-learn
Precision, recall, F1 definitions used by AI metric tools.