LLM Token Counter
Count tokens for ChatGPT, Claude, Gemini, Llama — accurate, free, runs entirely in your browser.
Accuracy notes
- OpenAI (GPT-5, GPT-4o, mini): 100% accurate — uses the official tokenizer.
- Llama, DeepSeek: uses the cl100k_base tokenizer, ~98% accurate.
- Claude, Gemini: estimated (Anthropic and Google do not publish their tokenizers). ±10% margin, good enough for cost estimates.
- Vietnamese typically uses 1.5-2× more tokens than English for the same content.
Why count tokens?
Every LLM API charges by tokens, not words. Knowing the count before you send a large prompt lets you:
- Estimate cost before running thousands of requests
- Make sure your prompt fits the model's context window
- Compare which model is more "token-efficient" for your text
How to use
- Pick the model you plan to use
- Paste text into the input box
- Token count + cost estimate update live
- Hit "Copy share link" to send to your team
Who this is for
Developers using ChatGPT/Claude/Gemini daily, AI engineers building RAG/agents, anyone paying LLM API and wanting quick metrics.
FAQ
Is my pasted data sent anywhere?
No. The tool runs 100% in your browser — no HTTP requests to TopDev servers or any AI provider. You can disconnect from the internet to verify.
Is this tool free forever?
Yes. All TopDev tools are free, no signup required, no usage limits.
Related tools
See all tools →API Cost Calculator
Estimate monthly/yearly LLM API spend. Compare which model is cheapest.
Prompt Builder
Compose well-structured prompts. 6 templates for common tasks.
NEWMarkdown Preview
Render markdown live — paste ChatGPT/Claude output. GFM, tables, code blocks.
NEWAI Model Comparison
GPT-5, Claude 4.7, Gemini 2.5, Llama 4, DeepSeek — context, pricing, modality (2026).