LLM Token Counter & Cost Estimator
Paste a prompt to estimate its token count and what an API call will cost. Live character, word and token counts, with editable per-million-token prices for input and output. Everything runs in your browser — nothing you paste is uploaded.
New to tokens? Read the guide →
0
Characters
0
Words
0
Lines
Estimated tokens
0
≈ 0 characters per token. This is an estimate — see the note below.
Cost estimate
Enter prices per 1M tokens (USD). Presets are example tiers — confirm current rates with your provider.
- Input cost
- $0.00
- Output cost
- $0.00
- Total (× calls)
- $0.00
Token counts are estimates. Different models use different tokenizers (BPE vocabularies), so exact counts vary by model. This tool blends the common characters÷4 and words×1.33 rules, which is accurate to within roughly 10–20% for typical English prose. Code, non-English text and unusual symbols tokenize less predictably. For exact billing, use your provider's tokenizer.
How to use the token counter
- Paste your prompt or text.
- See the estimated token count and a rough cost.
- It runs in your browser, so you can check sensitive prompts privately before sending them to an API.
What a token is
Language models do not read words; they read tokens, which are sub-word chunks. Common words are often a single token, while longer or rarer words split into several. A rough rule of thumb for English is about four characters per token, but that breaks down for code, punctuation, emoji and non-English text, which all tend to use more tokens than you would expect.
Why the count matters
APIs bill per token, for both the input you send and the output you get back, and your context window is measured in tokens too. Long system prompts and growing chat history quietly inflate every request. Estimating the count up front helps you predict cost and stay within limits. This is an estimate; tokenization differs between models, so use your provider's own tokenizer for exact billing.
For how tokenization works and ways to cut your bill, read how LLM tokenization works.
Where you'd use this
Estimating what a feature will cost before you build it, and understanding why a bill is higher than expected. Tokens are not words, and long system prompts are paid for on every single call.
For example: A support bot sends a 900-token system prompt with every message. At 50,000 conversations a month that is 45 million input tokens spent before a user types anything — trimming it to 300 tokens cuts two thirds of that line item.
Frequently asked questions
Why count tokens instead of words?
Language models bill and limit by tokens, not words — a token is roughly three-quarters of a word in English. Counting tokens lets you stay within context limits and estimate API cost.
Does the count match a specific model?
Token counts vary by model and tokenizer, so treat the result as a close estimate. It is accurate enough for budgeting prompts and avoiding context-limit errors.
Is my text uploaded?
No. Tokenisation runs in your browser; your prompt never leaves the page.