Count tokens in an LLM prompt exactly like OpenAI models do. Runs entirely in your browser using the same BPE tokenizer — your prompt is never uploaded.
0
Tokens
0
Words
0
Characters
Large language models don't process text word-by-word — they process tokens, sub-word chunks produced by a Byte Pair Encoding (BPE) tokenizer. API pricing, context window limits, and rate limits are all measured in tokens, not words or characters.
This tool uses the same o200k_base and cl100k_base BPE vocabularies used by OpenAI's GPT-4o and GPT-4/GPT-3.5 models respectively, so the count you see here matches what the API would bill you for.
On average, one token is roughly ¾ of a word in English, but this varies significantly with punctuation, code, non-English text, and rare words — which is why counting words or characters alone is unreliable for estimating cost or context usage.
Need a plain word count too?
Count words, characters, sentences and estimate reading time.