🔒 Processed locally in your browser — no data uploaded
← Back to Home

Token Counter

Input Text
Results

What the Token Counter does

This page estimates how many tokens a block of text will consume when you send it to a large language model, and what that text would cost at published list prices. It reports character and word counts alongside two token figures, one for GPT-family models and a slightly lower one for Claude, so you can test a prompt against a context limit before you call an API.

The counting is arithmetic rather than a real tokenizer. CJK characters are charged at roughly one and a third tokens each and every other character at about a quarter token, the same rule of thumb as four English characters per token. Numbers recalculate as you type, and a cost line applies per-million prices held inside the page to both the input and an imagined reply.

How to use it

  1. Paste the text to measureDrop your prompt, article or transcript into the box. The page opens with a short mixed-language sample so you can see the shape of the output immediately; select all and overwrite it with your own text.
  2. Read the four countsCharacters and words come first, then the two token estimates, each marked with a tilde because they are approximations. Compare the GPT figure against the context window of the model you plan to call.
  3. Check the cost lineBeneath the table, the token count is multiplied by stored per-million prices to give an input cost, a matching output cost, and a Claude figure. Treat the dollars as an order of magnitude rather than a quote for your account.
  4. Clear before comparing draftsEmpty the box to reset every number, then paste a second version of the text. Counting a trimmed-down rewrite against the original shows how many tokens the edit actually saved you.

Options and formats

GPT-family estimateNon-CJK characters at a quarter token each and CJK characters at about one and a third. That matches the four-characters-per-token behaviour those models show on ordinary English prose, and drifts on code and numbers.
Claude estimateA slightly lower ratio applied to the same split between CJK and other characters. Useful when you are weighing one provider against another, though the real count will differ by a few percent in either direction.
Cost projectionThe stats line multiplies your token estimate by per-million input and output rates plus a Claude input rate. Those rates were fixed when the page was written, so verify them against current vendor pricing before budgeting.
Live recalculationCounting runs on every input event rather than on a button press, so you can paste, delete a paragraph and watch the number move without extra clicks. The Clear button exists mainly to empty the box quickly.

Things to watch out for

It is not a real tokenizerNo vocabulary is loaded, so the estimate cannot know how a particular model splits punctuation, code or unusual words. Expect a few percent of error on plain prose, and considerably more on structured payloads.
Prose ratios break on structured textA quarter token per character holds for sentences. A block of JSON keys, a base64 string or a table of long digits tokenises far worse, often at one token per two characters or fewer, so those payloads cost more than the number shown.
Whitespace and emoji count as charactersIndentation, blank lines and repeated spaces all add to the character total, and an emoji is a single character here even though a real vocabulary may spend several tokens on it. Heavily formatted prompts run above this estimate.
The prices are hard-codedThe dollar figures come from per-million rates embedded in the page. Vendors revise rates, add cheaper tiers and discount repeated prefixes with caching, so use the cost line to compare two drafts, not to predict an invoice.

Frequently asked questions

Why do the two models give different counts?

Each provider trains its own vocabulary, so the same sentence is split in different places. Common English words usually become one token in both, while abbreviations, code and non-Latin scripts diverge most. Pick the figure for the model you will actually call rather than averaging them.

Do Chinese and Japanese really cost more?

Yes, measured per character. One CJK character frequently maps to a token or more, while four English characters fit into roughly one token. A page of Chinese text therefore lands near one token per character, several times the cost of the same message written in English.

Does the count include my system prompt?

Only if you paste it in. The tool measures exactly the text in the box, so a conversation carrying a long instruction block, tool definitions or worked examples will use more tokens than the display suggests. Paste the whole payload when you want a realistic figure.

How close is the dollar estimate?

Within a few percent on plain English prose, and less so on anything else. It is accurate arithmetic on approximate token counts at prices fixed inside the page. For quotas and invoices, count with the provider's own tokenizer and its current price list.

Should I budget for the model's reply?

Yes. Input and output are billed separately and output is usually the dearer side, so a prompt that looks cheap can still cost more once an answer is generated. Add your expected reply length to the input number before you commit to a batch job.

What about cached requests and streaming?

Neither is modelled here. Providers discount repeated prefixes when prompt caching is switched on, and streaming output is billed like any other output, so real spend can land below this figure. Read the number as an upper bound for one uncached call.