LLM Token Counter
Count tokens for GPT, Claude and Gemini as you type. Your prompts never leave your device.
Your text is tokenized locally in your browser and never uploaded, but avoid pasting secrets or production data you would not want on your own machine's clipboard.
Know your token count? Estimate the API cost.
About Token Counter
This token counter shows how many tokens your text uses across the major language models, updating live as you type or paste. OpenAI counts are exact because it runs the same tokenizers OpenAI ships — o200k_base for GPT-4o, GPT-4.1 and the o-series, and cl100k_base for GPT-3.5 Turbo and GPT-4. Claude is estimated with a subword tokenizer (o200k_base) and Gemini at roughly four characters per token — Anthropic and Google don't publish a browser tokenizer, so both are approximate for current models and clearly labelled. Alongside tokens you also get characters, words and a tokens-per-character ratio, which is handy for staying inside a context window or estimating prompt cost. Everything is tokenized locally in your browser, so the prompts you paste are processed on your device and never leave it.
Features
- Exact OpenAI token counts via o200k_base (GPT-4o, GPT-4.1, o-series) and cl100k_base (GPT-3.5 Turbo, GPT-4)
- Approximate Claude counts using a subword tokenizer, clearly labelled
- Approximate Gemini estimate at ~4 characters per token
- Live recount as you type or paste, with no Run button
- Characters, words and a tokens-per-character ratio shown alongside
- Exact-vs-approximate badges so you know which counts to trust
- Copy a one-click summary of every count for notes or tickets
- Runs entirely in your browser with no prompt upload
How to use the Token Counter
- Paste or type your prompt into the text box.
- Read the live token counts for OpenAI o200k, OpenAI cl100k, Claude and Gemini.
- Check the exact and approx badges to see which counts are precise.
- Use the characters, words and tokens-per-character stats to gauge context usage.
- Click Copy summary to grab every count at once.
Example
Input
Summarize this article in three bullet points.
Output
OpenAI o200k: 10 tokens (exact)
OpenAI cl100k: 10 tokens (exact)
Claude: 10 tokens (approx)
Gemini: 12 tokens (approx)
OpenAI counts are exact; Claude and Gemini are approximate estimates.
Common errors & troubleshooting
- The Claude count does not match my Anthropic dashboard usage exactly. — Treat Claude counts as approximate. Anthropic doesn't ship a browser tokenizer, so this tool estimates Claude with a subword tokenizer; confirm exact usage in your Anthropic console.
- The Gemini number looks rougher than the others. — Google does not publish a browser tokenizer, so Gemini is estimated at about four characters per token. Use it as a ballpark and verify with Google's count-tokens endpoint when precision matters.
- OpenAI o200k and cl100k show different counts for the same text. — That is expected. GPT-4o and the o-series use o200k_base while GPT-3.5 Turbo and GPT-4 use cl100k_base, and the two encoders split text differently. Read the count for the model family you are targeting.
- A very long document feels slow to recount. — Tokenizing large text on every keystroke is heavy. The counter recomputes only when the text changes; for huge inputs, paste in chunks if your browser stutters.
Frequently asked questions
- Are the OpenAI token counts exact?
- Yes. The counter uses the same byte-pair tokenizers OpenAI ships — o200k_base for GPT-4o, GPT-4.1 and the o-series, and cl100k_base for GPT-3.5 Turbo and GPT-4 — so those counts match what the OpenAI API charges.
- Why are the Claude and Gemini counts marked approximate?
- Current Claude and Gemini models tokenize on the provider's servers and do not expose an exact browser tokenizer. Claude is estimated with a subword tokenizer and Gemini uses a ~4-characters-per-token heuristic, so both are labelled approx.
- What is the difference between o200k and cl100k tokens?
- They are two OpenAI encodings. o200k_base is used by GPT-4o, GPT-4.1 and the o-series; cl100k_base is used by GPT-3.5 Turbo and GPT-4. They tokenize the same text slightly differently, which is why the counts can differ.
- How many characters are in a token?
- For English text it averages roughly four characters per token, but it varies with punctuation, whitespace, code and other languages. The tokens-per-character stat shows the real ratio for your exact input.
- Is my prompt sent to OpenAI, Anthropic or Google?
- No. All tokenization runs locally in your browser using bundled tokenizers, so the text you paste is processed on your device and is never uploaded to any model provider or to ArrayKit.
Related tools
- LLM API Cost Calculator — Estimate GPT, Claude and Gemini API costs from token counts, with custom price overrides.
- JSON to TOON — Convert JSON to TOON (Token-Oriented Object Notation) and back, with an LLM token savings estimate.
- OpenAI API Tester — Build, run and copy OpenAI Chat Completions API requests as cURL, Python and JavaScript.
- Anthropic Claude API Tester — Build, run and copy Anthropic Claude Messages API requests as cURL, Python and JavaScript.
- Google Gemini API Tester — Build, run and copy Google Gemini generateContent API requests as cURL, Python and JavaScript.
- Word & Character Counter — Count words, characters, sentences, lines, bytes and approximate tokens, live.
All ArrayKit tools