LocalExcelTool
Get started

Prompt Token Estimator

Paste a prompt to see its token count and what it costs as input on every major model — no login, nothing uploaded.

Runs in your browserNo account neededFree

What is Prompt Token Estimator

Token estimation approximates how many tokens a string will consume before it reaches a model. A workable rule of thumb is roughly 4 characters per token for English and about 1 token per character for Japanese and Chinese (kanji often take 1–2), multiplied by each model's price per million input tokens. Every vendor uses a different tokenizer, so treat the result as an estimate — the authoritative number is the usage.prompt_tokens field returned by the API.

Processed in your browser only. Nothing is uploaded.

Estimated tokens

60

Characters
239
Without spaces
198
Words
42
Lines
1
CJK characters
0

What this prompt costs as input

ModelVendorInput / 1MCost for this promptRuns per $1
GPT-6 LunaOpenAI$0.1000$0.000006166,666
Claude Haiku 5.5Anthropic$0.1000$0.000006166,666
Qwen3.8-FlashAlibaba Cloud$0.1500$0.000009111,111
Gemini 3.5 Flash-LiteGoogle$0.3000$0.00001855,555
DeepSeek FlashDeepSeek$0.3000$0.00001855,555
Gemini 3.8 FlashGoogle$0.7500$0.00004522,222
GPT-6.1 TerraOpenAI$1.00$0.0000616,666
Grok 4.3xAI$1.25$0.00007513,333
DeepSeek V4 ProDeepSeek$1.32$0.00007912,626
Qwen4-MaxAlibaba Cloud$1.50$0.0000911,111
GPT-6.2 SolOpenAI$2.00$0.000128,333
Claude Sonnet 5.5Anthropic$2.00$0.000128,333
Gemini 4 CarbonGoogle$2.00$0.000128,333
Grok 4.7xAI$2.00$0.000128,333
Gemini 4 NeonGoogle$3.00$0.000185,555
Claude Opus 5.5Anthropic$4.00$0.000244,166
GPT-6.2 AstraOpenAI$8.00$0.000482,083
Claude Fable 5.2Anthropic$8.00$0.000482,083

Token counts are rule-of-thumb estimates (about 4 characters per token for English, about 1 token per character for Japanese and Chinese). Real tokenizers can differ by roughly 15%. Output tokens and cache discounts are not included.

What this tool actually does with your file

Where it runs
In your browser, on this page
Upload
None — the file never leaves your device
Offline
Works with the network disconnected

Tokens are not words, and the ratio is language-specific

Tokenisers split text into subword units from a vocabulary learned during training, so the count depends on the tokeniser, not on the text alone. As a working rule, English prose runs about 4 characters or 0.75 words per token; Chinese, Japanese and Korean run closer to 1–1.5 characters per token because most characters are their own token or a fragment of one.

That means the same paragraph costs roughly three to four times as many tokens in Chinese as in English. Budgeting a prompt in words and multiplying by a fixed factor therefore underestimates CJK cost badly — this is the single most common cause of a context limit being hit earlier than expected.

What else sits in the context window

The system prompt, tool definitions, retrieved documents, conversation history and the model's own previous replies all occupy the same budget. A request that looks like 2,000 tokens of user text can be 15,000 tokens once tool schemas and history are counted.

Output tokens are capped separately and are charged at a different rate — usually several times the input rate. Estimating only the prompt therefore underestimates cost by a wide margin on tasks with long answers, such as summarisation or code generation.

Why any browser estimate is approximate

Exact counts require the model's own tokeniser, which is a large vocabulary file specific to each model family. An estimator that ships a simplified table will be within roughly 10–20% for English and wider for code, CJK, or text heavy in numbers and punctuation.

Use the estimate for budgeting and for deciding whether a document needs chunking, and use the provider's token-counting endpoint or the usage field of a real response when the number has to be exact. The difference matters at the boundary of a limit, not in the middle of one.

How to use it

  1. 1.Paste your prompt
  2. 2.Read the character count, estimated tokens and per-model input cost
  3. 3.Open the AI cost calculator when you need output tokens included

How Prompt Token Estimator works under the hood

Developer tools here are deterministic byte and string transformations. The useful question is not whether they are fast, but whether the output can be verified against a reference.

  1. 1

    Encode the input

    Text is converted to UTF-8 bytes with TextEncoder; binary input is read as an ArrayBuffer.

  2. 2

    Apply the primitive

    Hashing and HMAC use Web Crypto (SHA-1/256/384/512); encoding, escaping and formatting are pure functions over the bytes or string.

  3. 3

    Format the output

    The result is rendered as lowercase hex, Base64, or the target syntax, with the exact same rules the specification defines.

  4. 4

    Compare and copy

    Output stays on the page so you can diff it against a reference implementation before using it.

  5. Processing pipeline

Hashing is not encryption

A SHA-256 digest is one-way: there is no key and no way back. It proves that two inputs are identical (or not), which is what integrity checks need. It does not hide a password — for that you need a slow, salted KDF such as Argon2id, which this site uses for account passwords.

What runs where

Every transformation in this category runs in the tab. No key, token or payload is sent to us; the site cannot see what you hashed or decoded. That also means there is no server-side undo — if you close the tab, the input is gone.

Limits worth knowing

JWT decoding shows the header and payload; it does not validate the signature unless you supply the key, and it never proves the issuer is trustworthy. Regex-based tools can degrade badly on pathological input, so input size is capped. Very large payloads are also capped to keep the tab responsive.

Verify it yourself

Compare the output against a reference before you ship it.

  1. 1.Open DevTools on this page and switch to the Network tab
  2. 2.Keep the filter on Fetch/XHR and run the tool
  3. 3.Confirm no request carries your file — you should see only page assets and fonts

Frequently asked questions

How accurate is the token count?

It is an estimate. We assume about 4 characters per token for English and roughly 1 token per character for Japanese and Chinese. Real counts vary by tokenizer, typically within about 15%. For exact numbers, read usage.prompt_tokens from the API response.

Why do different models report different token counts?

Because they split text differently. A word that is one token in one tokenizer can be two in another, and the gap widens for rare words and code.

How is the price calculated?

Estimated tokens times each model's input price per million tokens. Output tokens and cache discounts are not included — use the AI cost calculator for a full per-request estimate.

Is my prompt sent anywhere?

No. Everything is computed in this page with JavaScript and nothing is transmitted, so it is safe to paste text you cannot share externally.

How do I cut tokens?

Three levers: say the same thing in fewer words, replace tables and prose with tight bullets, and cache long reference documents instead of resending them. Output tokens cost 3–5x input, so capping output length is usually the biggest saving.

What this kind of conversion cannot keep

Developer tools here check what breaks silently: a missing canonical, a description over the length search engines display, a sitemap that returns 200 but lists dead URLs. Each result links to the exact line or URL, because a warning you cannot act on is noise.

More in Developer