AI Token Counter — OpenAI & Anthropic
Paste text. See exact GPT-4o tokens and an Anthropic-tokenizer estimate side-by-side. All counting runs in your browser — nothing is uploaded.
OpenAI tokens (tiktoken)
0
cl100k_base
Anthropic tokens (approx.)
0
chars ÷ 3.5
Characters
0
Words
0
Est. input cost
$0.00
at selected model rate
What is a token?
A token is the atomic unit a large language model reads and writes. Models do not see words directly — they see token IDs from a fixed vocabulary that was learned during training. For English prose, a rough heuristic is that one token is about 3 to 4 characters, or about 0.75 of a word. Punctuation, whitespace, code, numbers, and rare or non-English words tend to consume more tokens.
Pricing on every major LLM API is denominated in tokens — usually per one million input tokens and per one million output tokens, billed separately. If you do not know how many tokens your typical request consumes, you cannot estimate your bill within an order of magnitude, much less plan margins on a product that wraps an LLM.
Why GPT-4o and Claude give different counts
Each model family ships with its own tokenizer — a learned mapping from text to token IDs. OpenAI moved from cl100k_base (used for GPT-4 and GPT-3.5) to o200k_base for GPT-4o and the o1 family. Anthropic ships a separate proprietary tokenizer for Claude 3 and 3.5 that is not the same as either OpenAI encoding. Google Gemini uses yet another tokenizer.
For English text, Claude tends to count about 10 to 20 percent fewer tokens than GPT-4o for the same input. For code, source files with lots of repeated identifiers, or non-Latin scripts (Korean, Japanese, Chinese, Arabic), the gap can be larger and the direction can flip. The only way to know your real bill is to count with the actual tokenizer that will be billed.
How to use this counter
Paste a representative sample of the text you will actually send — system prompt, user message, retrieved-context block, or a full conversation. Pick the model you plan to ship on. The cost panel uses the input-token price for that model from our pricing data. To estimate a full request bill, multiply your output-token estimate by the output rate and add it on top.
The Anthropic estimate on this page is an approximation derived from character count divided by 3.5. Anthropic does not publish a browser-usable tokenizer for Claude 3.x. For exact billing, hit Anthropic's count_tokens endpoint from your server — but for sizing, the approximation here is within roughly 10 percent of the real count for English prose.
Frequently asked questions
- What is a token?
- A token is the basic unit a language model reads. Roughly, one English token equals 3 to 4 characters or about 0.75 words. Punctuation, whitespace, and rare words consume more tokens.
- Why do GPT-4o and Claude give different token counts for the same text?
- Each model family uses a different tokenizer (a learned vocabulary). GPT-4o uses o200k_base; older OpenAI models use cl100k_base; Claude 3.x uses Anthropic's proprietary tokenizer. For English prose, Claude counts tend to be 10–20% lower than GPT-4o for the same input.
- How accurate is the Anthropic estimate on this page?
- The Anthropic count shown here is an approximation (characters divided by 3.5). Anthropic does not publish a browser-usable tokenizer for Claude 3.x. For exact billing accuracy, use Anthropic's count_tokens API endpoint on the server side.
- Does the cost estimate include output tokens?
- No. This page counts input tokens only. Real API calls bill input plus output. Output is unknown until the model responds, so plan a budget that assumes both. Use one of our calculator pages for end-to-end cost modeling.
- Is my text sent anywhere?
- No. All counting runs in your browser. Nothing leaves your device.