Tool guide
About this tool.
- A token is the unit a language model reads and writes. A short English word is often one token, a long or rare word is several, and punctuation, digits and emoji can each take a token or more. Prompt length, cost and context-window limits are all measured in tokens, not characters.
- Real counts come from a tokenizer that belongs to one model family, and different models split the same text differently. This tool does not ship a tokenizer and calls no API. It adds up a weight for each character class in one pass, so the answer is an estimate with an honest range.
- Latin letters, digits and single spaces weigh a quarter token. ASCII punctuation and letters of other scripts weigh half a token, Chinese, Japanese and Korean characters weigh one, emoji weigh two, and a newline or a run of other whitespace weighs one. The total is rounded up.
- Check whether a prompt, document or chat history is likely to fit in a context window before you send it.
- Compare the size of two prompt drafts while you shorten one.
- Judge roughly how much a long text will cost when a provider bills per token.
- Split work into pieces that stay well under a limit, keeping the upper bound of the range in mind.
Paste or type the text you want to measure. The estimate updates from that text alone; there are no options.
The first line shows the estimate and its range, for example about 3 tokens with a range of 2-4. The range is wider for code and for languages that are not Latin script, because the weights are less reliable there.
Below the note you find the text counts: UTF-16 units, code points, UTF-8 bytes, words and lines. After them comes the context fit, the share of five common window sizes that the high estimate could fill.
Copy the summary, save it as token-estimate.txt, or open the JSON report with the same numbers. The input is limited to 1,000,000 UTF-16 units.
- Hello world → about 3 tokens, range 2-4, margin plus or minus 20%.
- 日本語のテキスト → about 8 tokens, range 4-12, margin plus or minus 50%.
- {"a":1} → about 3 tokens, range 1-5; punctuation is most of the text, so the margin is plus or minus 40%.
- 👍 → 2 tokens, because every emoji weighs two.
- An empty input → 0 tokens, range 0-0.
- a b on one line and c on the next → 2 lines, 3 words, 5 UTF-8 bytes.
- Processing is local; nothing is uploaded and no tokenizer is downloaded.
- The estimate is a heuristic. Real token counts vary by model.
- The range is floor(estimate × (1 − margin)) to ceil(estimate × (1 + margin)).
- Words are counted with the browser word segmenter, so languages without spaces are split by it.
- Zero-width and combining characters add nothing to the estimate.
- The input is limited to 1,000,000 UTF-16 units; longer text is an error.