LLM Token Counter

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.

~±15% on English prose CJK-aware, not just chars/4 500K character input

Estimate tokens & input cost

Type or paste below — the estimate refreshes ~150ms after you stop typing.

Reference price table (reviewed 2026-09) — prices and context windows change; confirm with the vendor before you budget.
0 chars 0 words

Heuristic estimate — not a full BPE tokenizer.

Estimated tokens
0
Estimated input cost
$0.0000

Reference price, may change.

Context window usage
0% of the context window

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.

1 · Paste your text

Drop in a prompt, a doc, a JSON payload or a whole code file. Up to 500,000 characters are measured.

2 · Pick a model preset

Each preset carries its context window and its reference input price per million tokens, so the cost line follows your choice.

3 · Read the estimate

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.

Latin text & code

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.

CJK, Kana & Hangul

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%.

Noisy payloads

Base64 blobs, dense JSON, minified code, emoji runs and heavy punctuation can drift 30% or more. Use the estimate for sizing, not for billing.

Input side only

Cost covers the tokens you paste. Output length is your own guess, so it is deliberately left out of the figure.

Prices go stale

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.

Generic preset

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.

Latest updates

More free tools

Step-by-step guides in our blog & guides.

Free Meta Tag Generator Free Background Remover Tool Password Generator With Words ICS Calendar Generator Calcul Consommation Essence Trajet Font Generator For Discord Servers Unique YouTube Channel Name Generator Photo Compressor To 40kb Free Online Resume Builder Canada Video Merger Studio