Estimate tokens and cost before you send a prompt
This token counter estimates how many tokens a text uses and what one request would cost with the prices you enter. It updates as you type, shows characters and words too, and runs entirely in your browser. Use it to check whether a long document fits in one message or to budget an API project.
Token counts are estimates (±10%). Each model uses its own tokenizer; check your provider's pricing page for current prices.
🔒 Runs in your browser. Your text is not stored on our servers.
How to use it
Paste your text or prompt
Characters, words and estimated tokens update instantly as you type or paste.
Enter your prices
Type the input and output prices in USD per 1 million tokens from your provider's pricing page.
Set the expected answer length
Enter how many tokens you expect the reply to use (500 by default). The cost per request updates automatically.
What a token is
Language models do not read words or letters; they read tokens, chunks of text produced by a tokenizer. A common English word is often one token, a long or rare word can be two or three, and spaces, punctuation and numbers count too. Every limit and price in the AI world is expressed in tokens: the context window (how much text a model can consider at once), the maximum answer length and the cost of API calls.
Each model family uses its own tokenizer, so the exact same text produces slightly different counts in different models. That is why any counter that is not tied to one specific tokenizer, including this one, gives an estimate.
How this token counter estimates
The estimate combines two rules of thumb that work well for English and other languages written in the Latin alphabet: about four characters per token, and about 1.33 tokens per word. The tool calculates both and averages them, which smooths out texts with unusually long or short words. Chinese, Japanese and Korean characters are handled separately and counted as roughly one token each, since tokenizers split them much more finely. The result is usually within about 10% of the real count for ordinary prose.
Expect larger differences for code, URLs, long numbers, tables, emoji and languages with rich word endings, which tend to use more tokens than the rules of thumb suggest. If an exact number matters, for example when you are very close to a context limit, check with your provider's official tokenizer or the usage figures returned by the API.
Calculating cost per request
API providers charge separately for input tokens (your prompt, including any system prompt and pasted documents) and output tokens (the answer), usually quoted in dollars per million tokens. The calculator applies this formula:
cost = (input tokens × input price + expected output tokens × output price) ÷ 1,000,000
For example, with example prices of 1.00 for input and 4.00 for output, a 2,000-token prompt and a 500-token answer cost (2,000 × 1 + 500 × 4) ÷ 1,000,000 = $0.004. Multiply by the number of requests you expect per day to estimate a budget. Prices change and differ between models, so the fields start empty: copy current figures from your provider's pricing page.
Practical ways to use token counts
- Fit long documents: estimate the size of a report or transcript before pasting it, and split it into parts if it is close to the model's limit.
- Trim system prompts: a system prompt is sent with every message, so 300 tokens saved there are saved on every request. Write it with the system prompt generator and check its size here.
- Compare prompt versions: a longer prompt is not always better; see how much each added section costs.
- Estimate OCR output: after extracting text from a scan with the image to text tool, paste it here to see how much context it will take.
Pro tips
- Remember that chat apps also send earlier messages in the conversation; long chats use more tokens per turn than the last message alone.
- Add the system prompt and any attached text to the input count, not just your question.
- Set the expected answer length from your own usage: a short reply is often 100–300 tokens, a long article several thousand.
- Code and data use more tokens than prose of the same length; leave a safety margin.
- Recheck provider prices when budgeting; they change over time.
Frequently asked questions
How accurate is this token counter?
For normal English prose the estimate is usually within about ±10% of real tokenizer counts. Code, numbers and some languages can differ more. Use the provider's tokenizer when you need an exact figure.
Does it work for every model?
It gives a model-independent estimate, which is useful for any text model. Each model has its own tokenizer, so exact counts vary slightly between ChatGPT, Claude, Gemini and others.
Why are the price fields empty?
Prices differ by model and change over time, so the tool does not guess them. Enter current prices from your provider's pricing page in USD per million tokens.
How many words is 1,000 tokens?
For English, roughly 750 words, following the 1.33 tokens-per-word rule. Other languages and technical text usually need more tokens per word.
Is my text sent anywhere?
No. Counting and cost calculation happen in your browser; nothing is uploaded.
Related tools
Updated: