Token Counter — Free LLM Token Estimator for Any Text
Runs 100% in your browser — your files never leave your device.
Text becomes tokens before an AI model reads it, and every token counts against the context window and the bill. Paste any text — a prompt, a document, a chat history — and see how many tokens it likely costs on OpenAI, Claude, Gemini, and Llama, with a range and an average. Each provider counts slightly differently, so treat this as a planning estimate. Everything runs in your browser.
How it works
- 1
Paste your prompt or text
The estimate updates live as you type or edit — no button to press.
- 2
Read the per-provider estimates
OpenAI, Claude, Gemini, and Llama figures appear side by side, with a likely range and an average.
- 3
Trim until it fits
Cut words and watch the estimate fall toward your token budget for the context window or the request limit.
About this tool
How the token estimate is calculated
The estimator applies each provider's published characters-per-token average to your text — roughly 4 characters per token for OpenAI, about 3.5 for Claude, and values in between for Gemini and Llama — with spaces and punctuation included, because tokenizers consume them too. Text written in Chinese, Japanese, or Korean is estimated separately, since those scripts typically cost more than one token per character. Because real tokenizers split text by learned vocabulary rather than by a fixed ratio, the result is a planning estimate with a stated range, not an exact count.
Why token counts matter
Every AI request pays twice in tokens: the cost of the context window, where models simply refuse text that exceeds the limit, and the meter, where providers bill per token in and per token out. A prompt that fits today's window can break after you paste one long document, and an under-counted prompt quietly doubles your API bill once the model's reply is added. Estimating before you send keeps both under control.
Estimating tokens before you prompt
A real request carries more than your question: the system prompt, any few-shot examples, and retrieved documents all ride along and all count. Estimate each piece separately, add a margin for the model's reply, and keep the total under the limit with room to spare. For a raw length check first, run your draft through the word counter — a thousand English words is roughly 1,300 to 1,700 tokens depending on the model.
Why providers count differently
Each provider trains its tokenizer on its own vocabulary, so the same sentence can split into a different number of tokens on each platform — and providers update their tokenizers between model versions, shifting counts again. Non-English text, code, symbols, and rare words drift the furthest from the average. The tool shows the spread across providers so you can budget for the worst case, and you can analyze the text itself with text statistics to see what is driving the length.
Frequently asked questions
How accurate is the token estimate?
Expect the true count within roughly 10–20% of the estimate for everyday English prose. Short snippets, heavy code, emoji, and non-English text can drift further. For billing or a hard context-window decision, verify with the provider's own usage figures.
How many tokens is a word?
For English, plan on about one token per three-quarters of a word — roughly 4 characters per token including spaces. A thousand words therefore lands between about 1,300 and 1,700 tokens depending on the model.
Why do OpenAI, Claude, and Gemini disagree on counts?
Each tokenizer splits text with its own learned vocabulary, so identical text can produce different token counts on each platform. The estimate shows all four side by side so you can plan against the highest figure.
Does the counter use AI or send my text anywhere?
No — the estimate is pure arithmetic in your browser. No AI model runs, nothing is uploaded, and your text never leaves your device.
Do emojis and other languages change the count?
Yes. Chinese, Japanese, and Korean characters usually cost more than one token each, and emoji often cost several. The estimator adjusts for CJK scripts; for emoji-heavy or rare-script text, budget extra margin.