LLM Token Counter & Pricing Estimator
The LLM Token Counter calculates token counts using official OpenAI BPE tokenizers (o200k_base and cl100k_base) directly in your browser. It visualizes token chunk boundaries and estimates API costs across GPT-4o, Claude 3.5, Gemini 2.5, and DeepSeek with zero server calls.
Real-Time API Cost Calculator
Estimated costs for processing 117 tokens across top frontier & open-weight models.
| Model | Provider | Input Rate ($/1M) | Input Cost | Output Cost | Context Used |
|---|---|---|---|---|---|
| GPT-4o↗ | OpenAI | $2.50 | $0.0003 | $0.0012 | <0.1% |
| GPT-4o mini↗ | OpenAI | $0.15 | $<$0.0001 | $<$0.0001 | <0.1% |
| OpenAI o3-mini↗ | OpenAI | $1.10 | $0.0001 | $0.0005 | <0.1% |
| Claude 3.7 / 3.5 Sonnet↗ | Anthropic | $3.00 | $0.0004 | $0.0018 | <0.1% |
| Claude 3.5 Haiku↗ | Anthropic | $0.80 | $<$0.0001 | $0.0005 | <0.1% |
| DeepSeek V3↗ | DeepSeek | $0.28 | $<$0.0001 | $<$0.0001 | <0.1% |
| DeepSeek R1↗ | DeepSeek | $0.28 | $<$0.0001 | $<$0.0001 | <0.1% |
| Gemini 2.0 / 2.5 Flash↗ | $0.30 | $<$0.0001 | $0.0003 | <0.1% | |
| Gemini 1.5 / 2.5 Pro↗ | $1.25 | $0.0001 | $0.0006 | <0.1% | |
| Llama 3.3 70B (Groq)↗ | Meta / Open-Weights | $0.59 | $<$0.0001 | $<$0.0001 | <0.1% |
Different large language models tokenize text differently, affecting both prompt limits and API billing. This in-browser tokenizer calculates exact token counts for modern frontier models, highlights syllable and punctuation boundaries, and calculates live input/output API costs based on verified rates.
How to use the LLM Token Counter & Pricing Estimator
- Type or paste your text or code into the editor.
- Toggle between o200k (GPT-4o, o1, o3) and cl100k (GPT-4, Claude, DeepSeek).
- Enable 'Visualize Token Chunks' to see individual token boundaries.
- Review estimated input and output costs across frontier and open-weight models.
Common use cases
- Estimate API costs before dispatching large batch prompts or RAG contexts.
- Optimize prompt brevity and eliminate whitespace or formatting token waste.
- Ensure input contexts stay within context window limits (e.g. 128k or 200k).
- Compare token efficiency between o200k and legacy cl100k tokenizers.
Tips
- o200k_base (GPT-4o) tokenizes non-English text and code up to 20% more efficiently than cl100k_base.
- Spaces and punctuation marks often count as separate tokens — inspect the visual chunk breakdown to find optimizations.
Frequently asked questions
Is my text or prompt uploaded anywhere? +
No. Tokenization is performed 100% in your browser using pure JavaScript BPE implementations (js-tiktoken). Your text never leaves your device.
How are the API pricing estimates calculated? +
Costs are computed mathematically by multiplying your token count by the official published pricing rates per 1M tokens. Rates are verified against open-source community pricing registries.
What is the difference between o200k and cl100k? +
o200k_base is the 200,000-vocabulary tokenizer used by GPT-4o, o1, and o3-mini. cl100k_base is the 100,000-vocabulary tokenizer used by GPT-4 and acts as a close approximation for Claude and DeepSeek.