Count the tokens in a prompt
Estimate how many tokens a prompt costs before you send it, and work out the price from the rates you type in. The prompt never leaves the page.
- Free, no account
- Nothing is uploaded
- Runs in your browser
How it works
- 1 What goes in A prompt
- 2 It runs in your browser On your own device. Nothing is uploaded, there is no queue and no account, and it keeps working with the network switched off.
- 3 What comes back What it costs in tokens
What it does
Estimate the token cost of a prompt, with the count shown as a range rather than a single confident number. Type in the rates your provider charges and the price is worked out from your own figures — no price list here to go stale.
This page does the work itself. Your prompt is handled by the browser and never sent anywhere — there is no server here to send it to.
Questions
How accurate is the estimate?
Close enough to budget with, not close enough to bill with. Every model has its own byte-pair vocabulary, and the only exact count comes from that model's tokenizer or the provider's count-tokens endpoint. The estimate here follows the same rules every BPE vocabulary agrees on — whitespace attaches to the word that follows it, punctuation splits off, common words are one token, long or unusual words split into pieces — and is typically within a few percent for English prose. Code, non-Latin scripts and long strings of digits drift further, so the range widens for them.
Why does this page not list model prices?
Because a price list published today is wrong within months and nothing on the page would tell you. You type the rate your provider charges and the arithmetic is done on your number, which stays correct for as long as you keep it up to date — and the count itself, which is the part that takes work, never goes out of date at all.
Why is non-English text more expensive?
Tokenizers are trained mostly on English, so an English word is often one token while the same word in Thai, Hindi or Japanese can be several — sometimes one token per character. The same sentence can cost two or three times as much to send in one language as in another, which is worth knowing before you translate a system prompt.
Worth knowing
The count on this page is an estimate, and says so. When you need the exact number — for a hard budget, or a prompt sitting near the edge of a window — it comes from the model's own vocabulary.
-
tiktoken
The tokenizer GPT-family models actually use. Loads the real merge table, so the count it gives is the count you are billed for.
-
Hugging Face tokenizers
The same for most open-weight models: load the vocabulary that shipped with the model and count against it rather than around it.
Nothing on this list is paid for, and none of it is an affiliate link. These are plain URLs — no referral code, no tracking parameter, nothing that tells anyone you came from here.