Free · no sign-up · runs in your browser
LLM Token Counter
Paste a prompt, document or code file, pick a model preset, and get an instant estimate of the token count and the input cost — the numbers update as you type, with no upload and no account.
Estimate tokens & input cost
Type or paste below — the estimate refreshes ~150ms after you stop typing.
Heuristic estimate — not a full BPE tokenizer.
Reference price, may change.
Green zone <60% · amber 60–90% · red above 90%.
Method: Latin letters ≈ 4 chars/token with a word-boundary correction, CJK/Kana/Hangul ≈ 0.8 token/char, digits ≈ 0.4 token/digit, punctuation ≈ 0.5 token each, emoji ≈ 2 tokens. Code, JSON, base64 and emoji-heavy text can drift 30% or more, so treat every figure as an estimate.
How it works
Three steps, no button to press.
Drop in a prompt, a doc, a JSON payload or a whole code file. Up to 500,000 characters are measured.
Each preset carries its context window and its reference input price per million tokens, so the cost line follows your choice.
Token count, character/word counts, share of the context window and the input-side cost — all refreshed ~150ms after you stop typing.
Estimation rules & limits
What the heuristic assumes, and where it stops being reliable.
Roughly 4 characters per token, with a correction so short words cost a full token and long identifiers cost more. Expect ~±15% on English prose.
Weighted near 0.8 token per character instead of the naive 4-chars-per-token rule, which underestimates Chinese and Japanese text by 3–4x. Expect ~±25%.
Base64 blobs, dense JSON, minified code, emoji runs and heavy punctuation can drift 30% or more. Use the estimate for sizing, not for billing.
Cost covers the tokens you paste. Output length is your own guess, so it is deliberately left out of the figure.
The price table is static and was reviewed 2026-09. Vendors change pricing and context limits without notice — always confirm on the official pricing page.
The generic option falls back to a flat 4-characters-per-token count, shows “—” for cost and skips the context-window bar.
FAQ
Is my text uploaded anywhere?
No. The estimator is plain JavaScript inside this page — your text never leaves the browser, there is no request and no account.
How accurate is the estimate compared with tiktoken?
For English prose the heuristic usually lands within ±15% of cl100k/o200k token counts, and within ±25% for Chinese, Japanese and Korean. It is an engineering approximation, not a tokenizer replacement.
Why not ship the real BPE vocabulary?
Real vocabularies are 1–2 MB of data per model family and would stall first paint. The point here is instant, good-enough sizing while you write a prompt.
Why does the cost show “—” for the generic preset?
The generic preset has no model behind it, so there is no honest unit price to multiply by. Pick a concrete model to see a cost figure.
What happens with very long documents?
Anything past 500,000 characters is truncated for the estimate and the result area says so. Long inputs are measured in a single pass, so the page stays responsive.
Is the token count saved between visits?
No history, no storage. Reload the page and you start clean.