All tools
Interactive counter · free · no signup

LLM token counter & cost estimator

Paste any text and get an estimated token count shown as a range from two disclosed heuristics, plus what that text would cost at per-million-token prices you set yourself.

71 characters · 13 words

18 tokens (1718)

chars ÷ 4
18
words × 4/3
17
Est. input cost
0.000050.00005

Estimates only — exact counts need each model’s own tokenizer. Chat requests also add role and formatting overhead. Output is billed separately at 15 per 1M tokens.

How it works

The tool applies two heuristics and shows both, as a range rather than a false-precision single number. The first divides character count by four, reflecting the rough average of four characters per token in English prose. The second multiplies word count by four-thirds, reflecting that a typical English word is about 1.3 tokens.

The two estimates usually land close together on ordinary prose and diverge on unusual text — code, URLs, non-English languages, or long technical terms — which is itself a useful signal that heuristics are struggling and a real tokenizer is warranted. Both formulas are disclosed precisely so you can judge when to trust them.

Enter your model's price per million input tokens (and optionally output tokens) and the tool converts the estimated range into an estimated cost range. Prices are fully editable because they change too often to hardcode; take them from your provider's current pricing page.

Assumptions and limitations

Frequently asked questions

How many tokens is my text, exactly?

This tool cannot tell you exactly — no heuristic can. It gives a range from two disclosed rules of thumb (characters divided by 4, and words times 4/3), which is reliable enough for planning. For an exact count, run the text through your specific model's tokenizer or check the usage metadata in an actual API response.

How many tokens are in a word?

For ordinary English, roughly 1.3 tokens per word, or about four characters per token — the two heuristics this counter uses. Short common words are often a single token, while rare words, technical terms, and inflected forms split into several. Other languages and code deviate substantially from these averages.

Why do different tools give different token counts for the same text?

Because tokenization is model-specific: each model family uses its own vocabulary and segmentation rules, so the same text genuinely has different token counts on different models. Estimator tools add another layer of variance through their heuristics. Comparisons only make sense within a single model's tokenizer.

How do I estimate the cost of a prompt before sending it?

Get a token estimate for your text, add headroom for chat formatting and your system prompt, then multiply by your model's price per million input tokens — which you can enter directly in this tool. Remember the response costs separately at the output rate, which is typically higher per token.

Is the text I paste into this counter sent to a server?

No. Counting and cost math run entirely in your browser as client-side JavaScript. The text never leaves your machine, is not logged, and is not stored — which also means you can safely paste confidential drafts.