Prompt Token Counter
Paste a prompt and see how many tokens it consumes before you spend money sending it. Essential for staying inside context windows, estimating API costs, and understanding why your long prompt got truncated.
How to use
- Paste your prompt or document text into the input.
- Click Run to see the token count.
- Multiply by your model's per-token price to estimate the request cost.
Tokens are the units LLMs actually read, not words, not characters. A tokenizer splits text into subword pieces: common English words are often one token, rarer words split into fragments, and a rough English average is 4 characters or 0.75 words per token. 'The' is one token. 'tokenization' may be three.
Token counts matter in two places: cost and context. Every API bills per token, input and output separately, so a 50,000-token document in every request costs real money at scale, knowing the count before you architect a pipeline is the difference between a viable product and a billing surprise. Context windows are hard token limits: a model with a 128k window truncates or rejects anything beyond it, and truncation usually eats the middle or start of your carefully engineered prompt silently.
Non-English text tokenizes worse: Hindi, Japanese, and other scripts can cost 2-4x the tokens of equivalent English because tokenizer vocabularies are English-heavy. Budget accordingly for multilingual products.
Counts vary slightly between model families (different tokenizers), so treat any counter as a close estimate rather than an invoice, within a few percent for planning purposes. For exact billing, the API response's usage block is the source of truth.
Examples
Input: Summarize this article in three bullet points.
Output: ~9 tokens
Input: def add(a, b):
return a + b
Output: ~13 tokens, code tokenizes denser than prose due to symbols
Frequently asked questions
How many tokens is a word?
For English, roughly 0.75 words per token, or 4 characters per token, on average. Common words are single tokens. Rare or technical words split into multiple subword pieces.
Why does the same text show different counts for different models?
Each model family has its own tokenizer vocabulary. GPT, Claude, and Llama tokenizers split text differently, so counts vary by a few percent. Use the count as a planning estimate. The API's usage field is exact.
Do tokens include spaces and punctuation?
Yes, whitespace and punctuation consume tokens, usually attached to adjacent words. This is why minified JSON costs fewer tokens than pretty-printed JSON with indentation.
How do I reduce my prompt's token count?
Cut boilerplate instructions, deduplicate examples, minify embedded JSON/code, and summarize long context instead of pasting it raw. Halving input tokens halves that part of your bill on every single call.
Related tools
You get 10 free AI enhancements/day on this tool. Create a free account for higher limits, run history on your last 50 runs, and a ₹10 wallet that unlocks 300+ AI models.