Token Counter
Estimate how many tokens your prompt will use before you send it to an LLM. Runs entirely in your browser.
This is a heuristic estimate based on character and word counts, not the exact BPE tokenizer each provider uses. Expect it to land within roughly 10–15% of the real count for ordinary English prose. Code, non-Latin scripts, and heavy punctuation tokenize denser, so treat the number as a planning guide rather than a billing figure.
Why token count matters more than word count
If you are building anything on top of an LLM API, tokens are the unit that actually governs your work. Context windows are specified in tokens. Rate limits are specified in tokens. Billing is per token, on both the prompt you send and the completion you get back. Word count is a convenient proxy, but it is not what the model or the invoice is counting.
Paste a prompt above and you get an estimate before you spend anything on it. This is most useful when you are iterating on a long system prompt, stuffing retrieved documents into context, or trying to work out whether a batch job will fit inside a window.
Rough conversions
- 1 token ≈ 4 characters of English text
- 1 token ≈ 0.75 words — so 1,000 words is roughly 1,300 tokens
- A single page of prose ≈ 500–700 tokens
- Code tokenizes denser — expect noticeably more tokens per character than prose
Practical ways to cut token usage
When a prompt is too large, the instinct is to shorten the instructions. That is usually the wrong place to look. Instructions are typically a small fraction of a long prompt; the bulk is almost always injected context — retrieved documents, chat history, pasted files. Trim there first.
Other reliable wins: strip formatting and boilerplate from documents before injecting them, summarise old conversation turns rather than replaying them verbatim, and prefer compact serialisations. The same data as minified JSON rather than pretty-printed JSON can save a meaningful share of tokens on a large payload — our JSON minifier will do that in one click.
Frequently asked questions
What is a token?
A token is the unit a language model actually reads. It is usually a chunk of a word rather than a whole word: common words are a single token, rarer words split into several, and punctuation and whitespace often carry their own. English prose averages roughly 0.75 words per token.
How accurate is this estimate?
It is a heuristic that blends character count and word count, not the exact byte pair encoding your provider uses. On ordinary English prose it typically lands within 10 to 15 percent of the true count. Source code, JSON, non-Latin scripts and heavy punctuation all tokenize more densely, so the estimate drifts further on those.
Why do I need to count tokens at all?
Two reasons. Context windows are measured in tokens, so a prompt that overflows the window will be truncated or rejected. And API pricing is per token for both input and output, so token count is what your bill is calculated from.
Does the count differ between GPT, Claude and Llama?
Yes. Each family uses a different tokenizer, so identical text produces different counts. The model selector adjusts the characters-per-token ratio to approximate each family, but for exact numbers you should use the tokenizer your provider publishes.
Do output tokens count too?
Yes, and they are usually priced higher than input tokens. This tool measures the text you paste, so it estimates your input side only. Budget separately for the response you expect back.
More free developer tools
Dropout Developer hosts a growing set of free, no-signup utilities for self-taught developers: the Word Counter, the LLM Token Counter, the JSON Formatter & Validator, plus our AI Code Generator and AI Project Generator.