LLM Token Count Estimator
Estimate how many tokens your text will use across GPT-4o, Claude, Gemini and more, with a context-window gauge and side-by-side API cost estimates. Approximate (chars-per-token heuristic), not an exact tokenizer.
Input
Model
Used for the output side of the cost estimate.
Output
Token estimate
| Metric | Value |
|---|---|
| No data yet | |
Context window usage
Context window usage will appear here.
Cost estimation
| Model | Input tokens | Input cost | Output cost | Total |
|---|---|---|---|---|
| No data yet | ||||
Token visualization
Token visualization will appear here.
Guides
Paste any prompt, document, or code snippet and get an instant estimate of how many tokens it will use — plus a context-window gauge and side-by-side API cost estimates across GPT-4o, GPT-4, Claude 3.5 Sonnet, Gemini 1.5 and more. Everything runs live in your browser as you type; nothing is uploaded.
What is a token?
Large language models don't read characters or words directly — they split text into tokens, chunks that are often a whole word, part of a word, or a single punctuation mark. Billing, context limits, and rate limits are all measured in tokens, so knowing your token count before you send a request helps you:
- Stay inside a model's context window
- Estimate the API cost of a prompt
- Compare how different models encode the same text
As a rough rule of thumb, one token ≈ 4 characters of English prose, or about ¾ of a word.
This is an estimate, not an exact count
This tool uses a fast characters-per-token heuristic, tuned slightly per model family and nudged down for code-heavy text (where tokenizers split more aggressively). It is not a real byte-pair-encoding (BPE) tokenizer such as OpenAI's tiktoken or Anthropic's tokenizer.
That means the numbers here are close for plain English but will drift for:
- Code, JSON and markup — lots of symbols and short identifiers tokenize into more tokens per character
- URLs and long IDs — split into many small pieces
- Non-English and non-Latin scripts — usually cost more tokens per character
For exact billing figures, always confirm against the provider's own tokenizer or the token counts returned in an API response. Treat this tool as a quick planning aid.
How to use it
- Paste or type your text into the input box.
- Pick your target model — this sets the chars-per-token ratio, context window size and pricing used in the estimate.
- Optionally set expected output tokens so the cost table can include the output side of a request.
- Read the results: estimated tokens plus word and character counts, a context-window usage bar, a cost table comparing every supported model, and a colored token visualization.
Why do different models show different token counts?
Each model family encodes text a little differently, so the estimator uses a slightly different characters-per-token baseline per family (for example, Claude models are treated as marginally denser than GPT models). The counts shown are the tool's approximation of those differences, not the models' exact tokenizer output.
Does my text leave my browser?
No. The estimate is computed entirely on your device — your prompt is never sent to a server.