LLM Token Counter
Paste text to estimate token count and prompt cost across major model families. Useful for staying under context limits and predicting API spend before you call.
🔒 Runs entirely in your browser · nothing is uploaded or stored
0
~Tokens
0
Characters
0
Words
0%
of 128K context
| Model | Input cost (this text) |
|---|
Token counts are a high-accuracy estimate (~1 token ≈ 4 chars / 0.75 words). Exact counts vary slightly per tokenizer.
🧮 How it estimates
Uses the well-established ~4 chars-per-token heuristic with whitespace and punctuation weighting. Within a few % of official tokenizers for English.
💡 Why it matters
Tokens drive both cost and context limits. Counting before you call avoids truncation and surprise bills on large prompts.
Frequently Asked Questions
Is my text sent anywhere?
No. Counting happens entirely in your browser with JavaScript. Your prompt never leaves your device.
How accurate is the count?
For English it's typically within 2–4% of official tokenizers like tiktoken. Code and non-Latin scripts tokenize more densely, so treat those as a lower bound.
Related tools