LLM Token Estimator

Estimate prompt tokens from text length and word boundaries, with a clear uncertainty range.

Estimated token count 11
Indicative range 8–15 tokens
Words 9
Word pieces and punctuation marks 10
Inputs
Paste the prompt or text to estimate. The text stays in your browser.
Choose a broad text profile to widen or adjust the estimate range.
Results & Graph
Estimated token count
11
Indicative range
8–15 tokens
Words
9
Word pieces and punctuation marks
10
Characters
44

Estimated tokens vs. word and character counts

Graph 1 • Entered design case Domain-specific illustration generated from the active calculator inputs.
TEXT SEGMENTS1144 characters • tokenizer-specific counts may differ
Graph 2 • Engineering outputs Text size is observable; tokenization is model-dependent.
Characters 44 count Word-like pieces 10 count Estimated tokens 11 count
Graph 3 • Calculated response Use a tokenizer-specific count when exact billing matters.
Lower estimate 7 tokens Central estimate 11 tokens Upper estimate 16 tokens
Summary: 11 estimated tokens; use the stated range because model tokenizers differ.
Summary: This is a model-neutral estimate based on text length and word boundaries. Exact token counts require the tokenizer for the selected model.
⚠️ Estimate only. This tool does not run a provider tokenizer; multilingual text, code, and unusual formatting can differ substantially.
Interactive chart & math engine powered by CalculatorGraph

Formula: LLM Token Estimator

Estimated Tokens ≈ Character Count ÷ 4 for prose
actual tokens depend on model tokenizer and text.
Estimated Tokens ≈ Character Count ÷ 4 for prose; actual tokens depend on model tokenizer and text.
  • C: Unicode character count
  • T: Rough model-neutral token estimate

Worked example: A short English sentence

Estimate a prompt size before using a model.

  1. Count Unicode characters and word-like units.
  2. Use a content profile to choose a rough central token estimate.
  3. Show a broader range to reflect tokenizer differences.
Result: A short sentence is estimated at roughly 10 tokens; actual counts vary by model and encoding.

Frequently Asked Questions

Is this an exact GPT token count?

No. Exact counts require the tokenizer for the specific model and encoding.

Why are there two different word counts under the result?

Words counts space-separated words the way a person would, 9 for the default sentence. Word pieces and punctuation marks counts every run of letters or digits plus each separate symbol, so the full stop makes it 10. Tokenizers usually split punctuation off, so a large gap between the two counts warns that the text is symbol-heavy and may cost more tokens.

Do spaces and line breaks count toward the estimate?

Yes. The central estimate divides the total character count by the profile's divisor, and every space, tab and line break is a character. The default sentence is 44 characters including its eight spaces. Heavily indented code or text with many blank lines can therefore read higher here than in a tokenizer that merges whitespace runs.

Which text type should I choose for Markdown with code blocks?

Choose by volume. If most of the document is English explanation with a few short snippets, English prose is closer. If the code blocks, tables or URLs make up most of it, choose code or technical text, which divides by 3.3 instead of 4 and widens the range. When unsure, run both and plan around the higher result.

Why does the low end of the range sometimes sit close to the estimate?

The low end is the largest of several floors: a share of the piece count, 90% of the word count, and 70% of any Chinese, Japanese or Korean characters. For text made of many short words, the word floor dominates. Eighteen short words give a range of 16 to 20, because the tool will not assume they compress far below one token each.

Does the estimate include tokens for the model's reply?

No. It measures only the text you paste. Replies are generated output, usually billed at a separate rate, and their length depends on the model and your maximum output setting. You can paste a reply you already have to measure it, but for planning you need to set an expected reply length yourself.

Can I use this to check whether a prompt fits a context window?

As a first pass, yes. Use the high end of the range rather than the central figure, add room for hidden formatting and the reply, and compare with the model's limit. If the result lands close to the limit, check with that model's own tokenizer before relying on it, because the heuristic can be off by more than the margin you have.

Does the estimate scale in a straight line for long documents?

The central figure does. It is characters divided by a fixed number, so doubling the text doubles the estimate. Real tokenizers behave roughly the same way on uniform prose, but a long document mixing tables, code and prose can drift. Splitting it into sections and choosing a profile for each gives a better total than one profile for the whole.

Why does pasted JSON produce such a wide range?

Every brace, quote, colon and comma counts as a separate piece, so JSON has a high piece count relative to its length. A short object of about 45 characters showed 7 words but 29 pieces. The central estimate follows characters and stays low, while the high end follows the piece count and climbs, so the range spreads out to reflect that uncertainty.

Is the text I paste sent to a server or a model?

The field note on the page says the text stays in your browser. The calculation is only counting characters and word units and applying fixed ratios, so it has no need to contact a model provider. That makes it reasonable for checking the size of drafts you would rather not upload, though you should still follow your own data rules.

Will the same text get the same count on different models?

Usually not exactly. Each model family uses its own tokenizer with its own vocabulary, so the same paragraph can split into a different number of pieces. This estimator is model-neutral on purpose and gives one figure for all of them. Treat the range as covering typical variation for English, and expect wider gaps for code and other languages.

How should I estimate a chat with a long history?

Paste the history in the order the application will send it, including the system instructions and the newest message, and estimate the whole block. Many chat tools resend earlier turns on every request, so the input grows with each exchange. Estimating a single message on its own will understate the size of later requests considerably.

Eleven tokens for a nine-word sentence

Out of the box the estimator holds one sentence: The quick brown fox jumps over the lazy dog. It reports an estimated token count of 11, an indicative range of 8 to 15 tokens, 9 words, 10 word pieces and punctuation marks, and 44 characters.

The central figure is mostly simple division. With the English prose profile selected, the tool assumes roughly four characters per token, so 44 characters divided by 4 gives exactly 11 tokens. Spaces count as characters, and so does the full stop at the end. The estimate is also never allowed to fall below the word count, which here is 9, so the division wins.

The range takes a little more work. The low end is the largest of three floors. One multiplies the smaller of the estimate and the piece count by 0.78, which gives 7.8, rounded down to 7. Another takes 90% of the word count, which gives 8.1, rounded down to 8. The larger of the two, 8, becomes the bottom of the range. The high end takes the larger of the piece count and the characters divided by 3.2, about 13.75, and multiplies by 1.08, which rounds up to 15 tokens.

So the range is not a statistical confidence interval. It is a set of rules of thumb, some leaning on word boundaries and some on a denser characters-per-token ratio. That is worth knowing before you treat the top of the range as a guarantee. It is a reasonable ceiling for ordinary English, not a promise for every text you paste.

What the Text Type menu actually changes

There are three profiles: English prose, code or technical text, and multilingual or emoji. Each one swaps the characters-per-token divisor. Prose uses 4, code uses 3.3 and multilingual uses 3. A smaller divisor means more tokens for the same text.

Run the default sentence through each profile and you can see the effect. Prose gives 11 tokens with a range of 8 to 15. Code gives 13 tokens with a range of 8 to 20. Multilingual gives 15 tokens with a range of 8 to 22. Nothing about the text changed. Only the assumption about how densely a tokenizer will pack it.

The non-prose profiles also widen the range. The high multiplier rises from 1.08 to 1.2, and the piece-based floor uses 0.65 instead of 0.78. On the default sentence the low end stays at 8 because the word-count floor holds it there, but on symbol-heavy text the difference shows. That is deliberate. Code and non-English text are where model tokenizers disagree with each other the most, so the tool admits more uncertainty there.

Pick the profile that describes most of the text by volume. A prompt that is mostly English instructions with a short code snippet is closer to prose. A pasted source file with a one-line comment at the top is code. If you genuinely cannot decide, run both and plan around the higher one.

Words versus word pieces and punctuation marks

Two counts sit under the result. Words is what a person would count: runs of characters separated by spaces, 9 for the default sentence. Word pieces and punctuation marks splits further, treating each run of letters or digits as one piece and each punctuation mark or symbol as its own. The full stop makes that one 10.

The difference tells you something about the text. Try It's 3.14 dollars. It has 3 words but 6 pieces: the contraction It's, then 3, the decimal point, 14, dollars and the final full stop. With only 18 characters the estimate is 5 tokens and the range is 3 to 7. Tokenizers usually split punctuation and digits off from words, so the piece count is often the closer guide to what a model sees.

Structured text pushes this much further. A small JSON object with three keys, about 45 characters long, has 7 words but 29 pieces, because every brace, bracket, quote mark, colon and comma counts on its own. The character estimate stays low, 11 tokens under prose or 14 under code, but the high end of the range jumps to 32 or 35 because it follows the piece count.

When the piece count is much larger than the estimated token count, the text is symbol-heavy and the high end of the range deserves more weight than the central number.

Texts that stretch the character rule

Character division assumes average English word lengths. Text that breaks that assumption would pull a pure division badly off, so the estimator adds floors that catch the most common cases.

Lists of very short words are one. A string of 18 single letters and short words separated by spaces is only 36 characters, and dividing by 4 would give 9 tokens even though each word is likely to need its own. Because the estimate is never below the word count, the tool reports 18 tokens with a range of 16 to 20, which is much more believable.

Writing systems without spaces are another. Chinese, Japanese and Korean characters usually cost about a token each, so the estimator counts them separately and never estimates below that count. Ten characters of Japanese give 10 tokens with a range of 7 to 18 under the multilingual profile, even though the Words line shows 1 because the sentence has no spaces. Treat that as a reasonable midpoint, and lean toward the top of the range for text dense with rare characters.

Emoji are a third. The character count uses Unicode code points, so a family emoji built from three people joined by invisible connectors counts as 5 characters and 5 pieces. The estimate is 1 token with a range of 1 to 6. Real tokenizers often spend several tokens on such sequences, so for emoji-heavy text plan around the top of the range.

Using the range in a real decision

Different questions call for different ends of the range. If you are checking whether a prompt fits inside a model's context window, plan with the high figure, 15 in the default case, because running over a hard limit fails the request. If you are estimating a monthly bill across thousands of requests, the central figure is fairer, because over many calls the errors in each direction tend to offset.

For one-off prompts the difference is small and rarely worth worrying about. A sentence that costs somewhere between 8 and 15 tokens is noise in any budget. The range starts to matter when you multiply. A system prompt sent with every request, a retrieval chunk inserted into every query or a template used by an automated job can each be pasted here once, and the error is then multiplied by your request volume.

Once you have a token figure, the API Token Cost Calculator turns it into money at a per-million rate you enter, and the LLM API Monthly Budget Calculator scales it by daily requests. Feed those tools the high end if you want a budget that is unlikely to be exceeded, and the central figure if you want a best guess.

What you paste is not everything the model reads

The estimator counts exactly the text in the box and nothing else. A real request usually carries more. Chat applications add the earlier turns of the conversation. Agent frameworks add tool definitions and instructions. Many providers wrap each message in formatting tokens you never see.

None of that is in the 11 tokens the default sentence shows. If your goal is the size of a whole request, paste the full assembled prompt: the system instructions, any retrieved documents, the conversation history and the new user message, in the order they will be sent. Then add a margin for the hidden formatting.

The reply is also missing. Output tokens are generated by the model and usually priced at a different rate from input. The estimator can tell you the size of a reply you already have if you paste it in, but it cannot predict how long the next one will be. Set that number yourself from your maximum output setting or from replies you have measured.

Small pasting habits that skew the count

Because the central figure is pure character division, anything that adds characters adds tokens. Indentation in code is the obvious one. A file indented with four spaces per level carries a lot of whitespace, and every space is a character here. Real tokenizers often compress runs of spaces, so a heavily indented file may come out higher in this tool than in a provider's counter.

Copying from a web page or a PDF can drag in non-breaking spaces, soft hyphens, doubled line breaks and invisible characters. They inflate the character count without adding meaning. If the number looks too high, paste into a plain text editor first and copy again.

Markdown tables, long URLs and base64 data behave like code rather than prose. They are dense with symbols and short fragments, so the code profile is the better choice even if the rest of the document reads as English. And if you have trimmed a document to fit a limit, paste the trimmed version, not the original, so the 8 to 15 style range you get reflects what will actually be sent.

When a heuristic is no longer enough

This tool loads no tokenizer data at all. That keeps it fast and private, and it works the same for every model, but it also means it can never be exact. For most planning that is fine. A handful of situations call for the real thing.

If a prompt sits within a few percent of a context limit, use the tokenizer for that model before you rely on it fitting. If you are reconciling an invoice, use the usage figures the provider returns with each response, because those are what you are billed on. If most of your text is in a language other than English, measure a sample with the model's own counter and compare it with this estimate once; the ratio between the two tells you how far to adjust future estimates.

Used that way, the estimator is a quick first pass. It tells you whether a text is around 11 tokens or around ten thousand before you spend effort on a precise count.