LLM Token Counter
Count text tokens with o200k_base or cl100k_base, or use a rough estimate. Add your own input price to estimate text cost. Runs in your browser.
Enter text to load the selected encoding.
Enter an input price to estimate cost.
Cost covers only this text at your rate. Chat formatting, system messages, tools, images, output tokens and provider billing rules can change the final bill. Check which encoding your model uses.
About the LLM Token Counter
Count text tokens with the o200k_base or cl100k_base encoding, or choose a rough character-based estimate. The selected encoding downloads after you enter text, then counting happens locally. Until it loads, the result is clearly marked as an estimate. Choose the encoding documented for your model; this tool does not infer a model from its name. An exact text encoding count is not a complete chat request or API bill: message formatting, system instructions, tools, images and output tokens can add usage. Enter your own USD input price per million tokens to estimate the cost of this text only.
Features
- Text counts for o200k_base and cl100k_base encodings
- Clearly labelled rough estimates while an encoding loads
- Live token, character and word counts
- Optional text input cost using your own USD rate
- Text stays in your browser
How to use this tool
The LLM Token Counter works right in your browser — no signup, no installation. Follow these steps:
- Choose the encoding documented for your model, or Rough estimate.
- Paste text and wait for the selected encoding to load.
- Read the count and its exact-text or estimate status.
- Optionally enter your USD input rate per million tokens. This excludes chat overhead and output.
Frequently asked questions
What does this token counter count?
It encodes the text you enter with o200k_base or cl100k_base. Different encodings can produce different counts for the same text. Special-token spellings pasted into the box are treated as ordinary text.
Does this match my final API bill?
No. It counts this text, not a full chat request. System instructions, message formatting, tool definitions, images, output tokens and provider billing rules can change usage and cost.
Why does the count say estimate?
The rough mode uses one token per four characters, which can be inaccurate for many languages and inputs. This estimate also appears while an encoding downloads or if it cannot load.
Where do prices come from?
You supply the USD input price per million tokens from your provider. The tool has no built-in model prices and does not include output costs or discounts.
Is my text uploaded?
No. The encoding files download to your browser, but the text is processed locally.
Using the results
The LLM Token Counter processes supported inputs in your browser. Check the tool instructions for its method and limits: some tools use local models, while others use encoding libraries or fixed rules.