How LLM Tokenization Works
Large language models split text into sub-word units called tokens using Byte-Pair Encoding (BPE) or SentencePiece vocabularies. Common English words count as one token, whereas punctuation, code symbols, numbers, and non-Latin Unicode characters split into multiple smaller tokens.
The Estimation Formula Explained
Our estimator inspects ASCII characters, word counts, punctuation density, and non-ASCII Unicode characters locally in your browser:
Worked Examples
| Workload Type | Words | Estimated Tokens | Input Cost @ $2.00/1M |
|---|---|---|---|
| Short support ticket + system prompt | 350 | ~465 | $0.0009 |
| 10-page PDF report (English prose) | 4,500 | ~6,000 | $0.0120 |
| Large JSON product catalog snippet | 2,200 | ~4,900 | $0.0098 |
Frequently Asked Questions
How accurate is a browser-based token estimate?
For English prose, character-and-word blending is typically within 5% to 8% of exact OpenAI, Claude, or Gemini tokenizer counts, without transmitting sensitive prompts over the internet.
Why do JSON and source code use more tokens per word?
Braces, colons, quotes, and indentation increase symbol splits by 20% to 35% compared to plain prose. Switching intermediate AI inputs to Markdown or YAML often trims token bills immediately.
Do thinking tokens count toward the context window?
Yes. Reasoning models generate internal thinking tokens that occupy context space and are billed at output token rates.
Is my pasted text stored or logged?
No. TokenMeter runs 100% locally in your browser.