LLM Token Counter
Paste text to see token counts for 11 Claude, GPT and Gemini models, along with how much of each context window the text uses, side by side. GPT is counted exactly in your browser, with the o200k_base tokenizer for GPT-4o and later and cl100k_base for GPT-4 Turbo and GPT-3.5. Claude and Gemini do not publish their tokenizers, so those counts are approximations: the exact GPT count multiplied by a factor for each kind of character (letters and digits, CJK such as Japanese, and other). For an exact Claude count you need Anthropic's count_tokens API, which requires an API key. Character, word and line counts are shown too. It suits checking whether a prompt is too long and preparing for a cost estimate. Everything runs in your browser and your text is never sent anywhere.
Loading tokenizer dictionary…
Claude
approx.0
tokens
Estimate (Anthropic does not publish a tokenizer for Claude 3+)
GPT
exact0
tokens
o200k_base — GPT-5.5 / GPT-5 / GPT-4o / GPT-4.1
Gemini
approx.0
tokens
Estimate (Google does not publish a client-side tokenizer)
Per-model breakdown
| Model | Tokens | Context limit | Usage |
|---|---|---|---|
| Claude Fable 5.2approx. | 0 | 1M | 0% |
| Claude Opus 5.5approx. | 0 | 1M | 0% |
| Claude Sonnet 5.5approx. | 0 | 1M | 0% |
| Claude Haiku 5.5approx. | 0 | 1M | 0% |
| Claude Opus 4.8approx. | 0 | 200K | 0% |
| Claude Sonnet 4.5approx. | 0 | 200K | 0% |
| Claude Haiku 4.5approx. | 0 | 200K | 0% |
| GPT-6 Astra | 0 | 1.05M | 0% |
| GPT-6.1 Sol | 0 | 1.05M | 0% |
| GPT-6.1 Terra | 0 | 1.05M | 0% |
| GPT-6 Luna | 0 | 1.05M | 0% |
| GPT-5.5 | 0 | 1.05M | 0% |
| GPT-5 | 0 | 400K | 0% |
| GPT-4.1 | 0 | 1M | 0% |
| GPT-4o | 0 | 128K | 0% |
| GPT-4 Turbo | 0 | 128K | 0% |
| GPT-3.5 Turbo | 0 | 16K | 0% |
| Gemini 4 Argonapprox. | 0 | 1.05M | 0% |
| Gemini 4 Carbonapprox. | 0 | 1.05M | 0% |
| Gemini 4 Hydrogenapprox. | 0 | 1.05M | 0% |
| Gemini 3.8 Flashapprox. | 0 | 1.05M | 0% |
| Gemini 3 Proapprox. | 0 | 1M | 0% |
| Gemini 2.5 Flashapprox. | 0 | 1M | 0% |
Claude and Gemini counts are heuristic estimates derived from the exact GPT count and the character mix, and may differ from the real API count by roughly ±10–20%. Use them for rough sizing, not billing.
The tokenizer dictionary could not be loaded, so the GPT count is also an approximation.
Split into chunks (for RAG)
Splits the text above into pieces of at most the token count you set, keeping paragraph, sentence or line boundaries where possible. Overlap repeats the end of one chunk at the start of the next.
Enter text above first.
Counted with the GPT-4o tokenizer (o200k_base).
Token viewer
Shows how the text above is split into tokens by the GPT tokenizers (GPT-4o / GPT-4). Each token has its own colour. Claude and Gemini use different tokenizers, so their boundaries differ.
GuideHow to use & features
- Paste a prompt, document, or code into the text area and the counts update automatically.
- The tokenizer dictionary used for the exact GPT count is loaded on first input (a loading note is shown).
- The Claude and Gemini cards carry an "approx." badge — expect roughly ±10–20% deviation.
- Character, word, and line counts are shown as well, so you can gauge overall text size.
SamplesSample input & output
Short English sentence
The quick brown fox jumps over the lazy dog.
GPT: 10 tokens (exact) / Claude: ~11 tokens / Gemini: ~10 tokens
Short Japanese sentence
吾輩は猫である。名前はまだ無い。
GPT: 14 tokens (exact) / Claude: ~19 tokens / Gemini: ~12 tokens — CJK text tends to use more tokens than English
FAQFAQ
What is a token?
A token is the smallest unit an LLM uses to process text. In English one token is roughly four characters (a word fragment); in CJK languages a single character can be one or more tokens. API pricing and context-window limits are both measured in tokens, so knowing the count ahead of time is useful.How many words is 1,000 tokens?
For English prose, a common rule of thumb is about 4 characters or ¾ of a word per token, so 1,000 tokens is roughly 750 words. That puts 4,096 tokens at about 3,000 words and a 200K-token context window at about 150,000 words. Code, numbers and non-English text usually use more tokens for the same length, so paste a sample into the counter to measure your actual text.How many characters are in a token?
About four characters for typical English text. The ratio varies with the content: CJK text, code and rare words tend to use more tokens for the same number of characters, so the only reliable way to know is to count your own text with the tool above.Is the GPT count exact?
Yes. The tool runs the o200k_base tokenizer — the one used by GPT-4o, GPT-4.1, and the o-series models — directly in your browser, so it matches the OpenAI API count. Note that the chat API adds a few extra tokens of message-structure overhead.Why are the Claude and Gemini counts approximate?
Anthropic has not published the tokenizer used by Claude 3 and later, and Google does not offer a client-side tokenizer either. This tool estimates their counts from the exact GPT count and the character mix, which can deviate from the real API count by roughly ±10–20%. Use the vendors’ count APIs when you need exact numbers.Why does Japanese text produce more tokens than English?
Tokenizer vocabularies are built primarily from English text, so common English words often map to a single token, while Japanese characters are frequently split into one or more tokens each. The same content in Japanese typically uses 1.5–2× more tokens.Can I use this as a Gemini or Claude token counter?
Yes, for sizing. The Gemini and Claude figures are estimates (roughly ±10–20%), good for checking whether a prompt fits a context window. When you need exact numbers, use the vendors’ own counting: the Gemini API’s countTokens method and the token-counting endpoint in Anthropic’s Messages API.Does it support Mistral, Llama or Qwen?
Not specifically. Those models use their own tokenizers, so their real counts will differ. The GPT (o200k_base) figure can serve as a rough guide for other models, but check with the model’s own tokenizer when precision matters.Is my text sent anywhere?
No. Everything, including loading the tokenizer dictionary, happens inside your browser. Your text never reaches a server, so it is safe to paste confidential documents or source code.
Use casesCommon use cases
Estimating prompt costs
API pricing is token-based. Check how many tokens a long system prompt or RAG context consumes before shipping it, and estimate the cost.Checking context-window limits
Before passing a whole document or log file to an LLM, verify that it fits within the model’s context window (e.g. 200K tokens).Comparing token efficiency across models
The same text tokenizes differently per model. Compare Claude, GPT, and Gemini side by side to gauge which is more cost-efficient for your content.Optimizing non-English prompts
CJK text tends to use more tokens than English. Measure how much you save by rewriting or shortening a prompt.
NotesNotes & limitations
Claude and Gemini counts are estimates
Anthropic and Google do not publish their tokenizers, so those values are inferred from the exact GPT count and the character mix. They may deviate ±10–20% from the real API count — do not use them for billing.Chat API overhead is not included
The counts cover only the pasted text. Chat APIs add a few tokens of message-structure overhead, and system prompts and tool definitions consume tokens separately.Tokenizers change between model generations
The GPT count uses o200k_base (GPT-4o / GPT-4.1 / o-series). Older models such as GPT-3.5 and GPT-4 use cl100k_base and will differ. Vendors may also change tokenizers in the future.Use the official count APIs for exact numbers
Anthropic’s count_tokens API and Google’s countTokens API return the exact count for the actual model (this requires sending your text to them).
Articles for this tool
LLM Token Counter: Check Claude, GPT & Gemini Token Counts in Your Browser
Paste text and compare token counts for Claude, GPT and Gemini. Covers token basics, why tokenizers differ per model, and the limits of estimates.
LLM API Cost Calculator: Compare Claude, GPT & Gemini Pricing Side by Side
Paste a prompt, set expected output tokens and compare per-request API costs across Claude, GPT and Gemini. Covers pricing structure and estimate limits.
