Don's Tools · Developers · Token Counter & Cost Estimator

LLM token counter & cost estimator

Paste your prompt to count tokens and estimate cost across models. Exact for GPT, with live prices and context limits that update themselves, plus a context budget bar, all in your browser.

0Tokens
0Characters
0Words
Loading tokenizer...

Model & cost

Loading live pricing...
$0Input cost
$0Output cost
$0Total
Context usage shows once a model is selected.
Pricing source: loading...
Token Counter & Cost Estimator counts the tokens in any prompt and estimates what it will cost across models. GPT counts are exact using the real tokenizers, while Claude, Gemini and others are approximated with the GPT-4o tokenizer as a labelled proxy. Model prices and context windows are fetched live from LiteLLM's open dataset, so they stay current with no manual updates, and a context budget bar shows how much of a model's window you are using. Advanced options add expected output tokens, call counts, a tokenizer selector, custom rates and a token breakdown. Your text never leaves the browser.

Files are processed in your browser and never uploaded.

How to use LLM token counter & cost estimator

  1. Add your text

    Type or paste your text into the input box. Everything is handled by your own browser, so nothing is sent to a server.

  2. Set the options

    Choose Model (type to search). The options are visible from the start, not hidden until you paste something.

  3. Run it and keep a copy

    Press Advanced options ▾ to produce the result. Copy summary puts the result on your clipboard.

What this tool does

Exact GPT token counts, approximate for other models

GPT models are counted exactly with the real tokenizer. Other models are approximated, and the page says which you are getting.

Live, auto-updating prices and context windows

Prices and context windows update themselves, so a cost estimate does not quietly go stale when a model is repriced.

Input, output and total cost for any model

Input, output and total cost are worked out for the model you pick, with your own rates if you have negotiated different ones.

Context window budget bar

The context budget bar shows how much of the model's window your prompt uses, which is the limit people hit first.

Token breakdown view for advanced use

The token breakdown shows the text split into the actual tokens, which is how you find out why a short prompt costs so much.

Runs in your browser, nothing uploaded

The text is tokenised in your browser, so a prompt you have not shipped yet is never uploaded.

Frequently asked questions

Is my text uploaded anywhere?

No. Your text is tokenised and counted entirely in your browser and is never sent anywhere. The only network request is to fetch the public price list, which contains no text of yours.

How accurate are the token counts?

For GPT models the count is exact, using the real OpenAI tokenizers. Claude, Gemini and other providers have no public tokenizer, so those counts are approximate, calculated with the GPT-4o tokenizer as a close proxy and clearly labelled as such.

Where do the prices and limits come from, and are they current?

They are fetched live from LiteLLM's open, community-maintained dataset, which is updated very frequently and often on the day new models launch. Nothing needs manual updating. If it is ever unavailable you can type your own rate in the advanced options.

What does the context window bar show?

It compares your input tokens, plus any expected output tokens, against the selected model's maximum context window, so you can see how much room is left before you hit the limit.

Does it still work without the live pricing?

Yes. Token counting works on its own once the tokeniser loads. For cost, if live pricing has not loaded you can enter a custom input and output rate in the advanced options and the totals update normally.

Last updated: