Token Counter
Visualise how AI models split text into tokens
What is a token? LLMs don't read words — they read tokens: fragments of roughly 3–4 characters. A word like
tokenization becomes three tokens: token + iz + ation. Tokens determine both latency and cost — every API call bills per token.(Approximation of cl100k_base, the encoding used by GPT-4 and Claude.)10
Tokens
9
Words
44
Chars
Token breakdown(each colour = one token)
The·quick·brown·fox·jumps·over·the·lazy·dog.
Middle dots (·) represent spaces. Hover a token to see its index and character count.
ModelInput /1MOutput /1MThis inputEst. output×3
GPT-4oOpenAI
$2.5$10$0.000025$0.000325GPT-4o miniOpenAI
$0.15$0.6$0.000002$0.000019Claude Sonnet 4Anthropic
$3$15$0.000030$0.000480Claude Haiku 3.5Anthropic
$0.8$4$0.000008$0.000128Gemini 1.5 ProGoogle
$1.25$5$0.000013$0.000163Gemini 1.5 FlashGoogle
$0.075$0.3<$0.000001$0.000010"Est. output×3" assumes the model generates 3× the input tokens — adjust for your use case. Prices approximate as of mid-2025.
~4 chars per token
Rough rule for English prose. Technical jargon, code, and non-English text often use more tokens per word.
Spaces are part of tokens
In GPT-4 / Claude encoding, a leading space is merged with the following word — " hello" is one token, not two.
Context window = token budget
Models have a fixed context window (e.g. 200K tokens for Claude). Your prompt + history + response must all fit.