deftools.io Developer Tools

🔢 LLM Token Counter

Count tokens for GPT-4o, GPT-4, Claude, Gemini, Llama and Mistral

0 chars · 0 words
≈ 0 tokens
Model Est. tokens Context Context used

Counts are estimates. Each model family tokenizes differently, so treat these as close approximations rather than exact billing figures.

About this tool

Large language models don't read characters or words — they read tokens, subword pieces produced by a byte-pair encoding. A token is roughly ¾ of a word in English, so 1,000 tokens is about 750 words. Token counts drive both the cost of an API call and whether your prompt fits inside a model's context window.

Paste any prompt or document and this tool estimates the token count for the major model families side by side. Example: the sentence Summarize this in 3 bullet points. is around 8 tokens; a 500-word email is roughly 650–700 tokens. The context-used bar shows how much of each model's window your text would occupy.

Different families tokenize the same text slightly differently — OpenAI's newer o200k encoding is a little more compact than cl100k, while Claude and Llama tend to produce a few more tokens for the same input — so the per-model numbers vary by design.

FAQ

How accurate is the count?

It is a close approximation, not the exact figure a provider bills. The estimate models byte-pair tokenization heuristically; for plain English text it is usually within a few percent, but code, non-Latin scripts and unusual formatting can drift further.

What is a token?

A token is a chunk of text a model processes as one unit — often a whole short word, a word fragment, or a piece of punctuation. Common words are single tokens; longer or rarer words split into several.

How do tokens relate to words?

For typical English, one token is about 0.75 words, so 100 tokens ≈ 75 words. The ratio changes with language, code, and numbers, which tokenize into smaller pieces.

Why do the models show different totals?

Each family uses its own tokenizer and vocabulary. The same text produces different token counts depending on how the vocabulary was trained, which is why the table lists each model separately.

More developer tools

Copied!