Token Counter
Count GPT tokens, characters and words, with token boundaries highlighted.
How it works
Language models read tokens, not characters or words. These tokenizers use byte-pair encoding (BPE): start from raw bytes and repeatedly merge the most frequent adjacent pairs, learned from a large corpus. Common words become one token; rare words, code, emoji and non-English text split into several.
o200k_baseis used by the GPT-4o family;cl100k_baseby GPT-4 and GPT-3.5. They give different counts for the same text.- Each colour block is one token. A single character (like some emoji) can span several tokens; those are shown merged so the text stays readable.
- Counts are exact for these OpenAI encodings only. Other models (Claude, Llama, Gemini) use their own tokenizers, so treat the number as a rough guide for them.
- A rule of thumb for English: about 4 characters or 0.75 words per token.
Related tools
LLM VRAM Estimator
Estimate GPU memory to run or fine-tune an LLM, and see which GPUs it fits on.
Param Counter
Count parameters and fp32 memory for Dense, Conv2D, Embedding, LayerNorm and attention layers.
Conv Shape Calculator
Track tensor shapes through stacked Conv2D, MaxPool and AvgPool layers.