Home › Blog › LLM Token Counter
LLM Token Counter
Paste a prompt to see roughly how many tokens it uses and what it costs at your traffic. Then learn how to get exact counts and how to send fewer tokens.
An estimate based on English averages (about 4 characters or 0.75 words per token). Exact counts depend on each model's tokenizer. Example price; use your model's current rate.
For English text, one token is about four characters or three quarters of a word. Code, numbers and other languages usually take more tokens. For exact counts, use your provider's tokenizer or the usage data in API responses.
What is a token?
Models don't read characters or words. They read tokens: common words, pieces of words, punctuation and whitespace. You pay per token for everything you send (input) and everything the model writes back (output).
Why counts differ between models
Each provider uses its own tokenizer, and tokenizers can change between model generations. The same prompt can produce a different token count on OpenAI and on Claude, or even on two Claude generations. Treat this page as an estimate and measure the real number for the model you use.
How to get exact counts
- From real traffic: every API response includes input, output and cached token counts. This is the number you're billed for.
- OpenAI, before sending: OpenAI's open-source tokenizer library counts tokens for its models.
- Anthropic, before sending: the token counting endpoint returns the exact input count for a Claude request.
How to use fewer tokens
- Cut repeated instructions and examples that don't change the output.
- Send compact JSON without indentation when the model only needs the data.
- Trim chat history and retrieved documents to what the current question needs.
- Keep the stable part of your prompt identical so it gets cached and billed at the lower cached rate.
To see what these savings are worth at your volume, use the LLM cost calculator.
Want us to find your 20%?
Book a free 15-minute API cost teardown. Bring last month's provider usage and we'll show you your biggest waste and the first fix we'd ship.
Get My Free 15-Minute API Cost TeardownFrequently asked questions
How many characters is a token?
For English text, about four characters or three quarters of a word on average. Code, numbers and non-English text usually take more tokens per character.
Why do OpenAI and Claude give different counts for the same text?
Each provider uses its own tokenizer, and tokenizers can change between model generations.
Do spaces and line breaks count?
Yes. Whitespace and formatting are tokenized too, so heavily indented JSON or repeated blank lines add tokens.