OpenReplay Logo
12k
12k

LLM token counter

Count tokens for GPT, Claude, Gemini and Llama prompts and see exactly how your text is split — exact tiktoken counts for OpenAI, labelled estimates elsewhere, all in your browser.

Exact · tiktoken o200k_base
Processed locally
0
Tokens
0
Characters
0
Words
0
Tokens / word
Token breakdown
Token chips appear here as you type.

About this tool

Large language models don't read characters or words — they read tokens, the sub-word chunks a tokenizer splits text into. Token counts drive both context limits and API billing, so knowing how many tokens a prompt uses is the difference between a request that fits and one that's truncated or unexpectedly expensive. This counter shows a live token count alongside character and word counts, plus a colorized view of the segmentation so you can see exactly where the boundaries fall.

Pick a model to switch tokenizers. OpenAI models use tiktoken — o200k_base for GPT-4o and GPT-4.1, cl100k_base for GPT-3.5 — and produce exact counts identical to the API. Anthropic, Google and Meta do not publish an official browser-side tokenizer, so their counts are character-based estimates: useful for planning, but verify against the provider's own usage reporting before relying on them for billing.

Your text is tokenized entirely in your browser — nothing is uploaded, and the tiktoken tables load on demand the first time you count.

Frequently asked questions

What is a token?

A token is the unit a language model processes: a common word is often a single token, while longer or rarer words split into several. As a rough rule one token is about four characters of English, or roughly three-quarters of a word — but the only exact figure is the one the model's own tokenizer produces.

Are the counts exact?

For OpenAI models, yes — this tool runs the same tiktoken encodings (o200k_base and cl100k_base) the API uses. For Anthropic, Google and Meta models there is no official public client-side tokenizer, so those counts are character-based estimates and are clearly labelled as estimates.

Why does the same text use a different number of tokens per model?

Each model family is trained with its own tokenizer and vocabulary, so identical text splits differently. Newer vocabularies like o200k_base generally pack common English into fewer tokens than older ones, and code or non-Latin scripts can differ substantially between families.

Does it handle emoji and other languages?

Yes. Counts cover the full input including emoji, CJK characters and accented letters. In the colorized view, a character a model encodes across several tokens is merged into one readable chip, while the count still reflects every underlying token.