Token Counter for GPT, Claude, Gemini and Llama
Count tokens with the real BPE vocabulary, see every token coloured in place, and compare the count across models.
This token counter runs the real byte-pair-encoding vocabulary in your browser: o200k_base for GPT-4o and later, cl100k_base for GPT-4 and the embedding models. It shows the exact token count, every individual token highlighted in place, characters per token, and the same text measured against Claude, Gemini and Llama. Nothing you paste is uploaded.
Runs in your browser- Exact for
- o200k_base and cl100k_base — the published OpenAI vocabularies
- Estimated for
- Claude, Gemini, Llama, Mistral and DeepSeek — no published vocabulary
- Typical English
- ~4 characters per token
- Typical JSON or code
- ~2.5 characters per token
- Privacy
- Runs entirely in your browser — nothing is uploaded
- Cost
- Free, unlimited, no sign-up
Frequently asked questions
Why is the token count different from characters ÷ 4?
Is the Claude token count exact?
Does my text get uploaded?
Why do two models give different counts for the same text?
How to use the llm token counter
- 1Enter or paste your text.
- 2Choose the tokeniser.
- 3Turn "Show every token" on or off as needed.
- 4Press Run, then download the result when it is ready.
Sources & specifications
Embed this tool
Put the working llm token counter on your own site. It runs in your visitors' browsers exactly as it does here — free, no account, nothing uploaded.
Share this tool
Related tools
Context Window CalculatorPaste a document and see which models it fits inside, how much of each window it fills, and what is left for the reply.Words to Tokens ConverterConvert between words, characters, pages and tokens using measured ratios for prose, code, JSON and CJK.LLM Model ComparisonEvery current model side by side: price per million tokens, context window, max output, modalities and cache rates.Chat Export FormatterDrop in an exported conversations file and get clean Markdown, HTML or plain text — one document per conversation.Prompt Injection SanitizerStrip invisible carriers, neutralise instruction-like markup and fence untrusted content before you paste it into a prompt.AI API Cost CalculatorWork out what a prompt costs per call, per day and per month, and compare the same workload across every major model.
Last updated
More ai & llm tools