AI Token Counter
Paste any text to count its tokens instantly. OpenAI models (GPT-5, GPT-4o, GPT-4) are counted with the exact same tokenizer the API uses; Claude, Gemini and Llama show clearly-marked estimates. Nothing you paste ever leaves your browser.
Tokens
0
Words
0
Characters
0
Cost (input)
$0
How this token counter works
Tokens are the chunks language models actually read — and bill on. OpenAI splits text with byte-pair encoding (BPE): this page loads OpenAI's real vocabulary tables (o200k_base for GPT-5 and GPT-4o, cl100k_base for GPT-4) and runs the identical encoding in your browser, so the count matches what the API charges you.
Anthropic and Google have not published their tokenizers, so Claude, Gemini and Llama are estimated from character ratios instead. We label those results honestly rather than showing a precise-looking number that isn't.
| Model family | Counting method | Accuracy |
|---|---|---|
| GPT-5, GPT-4o, o-series | o200k_base BPE | Exact |
| GPT-4, GPT-3.5 | cl100k_base BPE | Exact |
| Claude | ~3.5 characters per token | Estimate, ±5% |
| Gemini | ~4 characters per token | Estimate, ±5% |
| Llama | ~4 characters per token | Estimate, ±5% |
From tokens to dollars
The formula is simple: cost = tokens ÷ 1,000,000 × price per 1M. 40,000 input tokens on a $2.50/1M model cost $0.10. The catch is that output tokens usually cost 3–5× the input rate, so a realistic budget needs both numbers — that is exactly what our API cost calculator (shipping next) is for.
Frequently asked questions
How many words is 1,000 tokens?
Roughly 750 words of English text. English averages about 1.3 tokens per word, so 1,000 tokens ≈ 750 words ≈ 4,000 characters. The ratio shifts for other content: Spanish and French run 1.5–2 tokens per word, and CJK languages can exceed one token per character.
How many characters are in one token?
For English, one token averages about 4 characters, including the space that follows it. Common words like "the" or "and" are single tokens, while rarer words split into several. Non-Latin scripts generally use more tokens per character than English.
Is my text sent to a server?
No. This counter runs entirely in your browser using a JavaScript port of OpenAI’s tokenizer. Your text is never transmitted, logged, or stored — close the tab and it is gone.
Why is the Claude or Gemini count marked as estimated?
Anthropic and Google have not published their tokenizers, so no third-party tool can count their tokens exactly. For those models we estimate from per-provider character ratios — about 3.5 characters per token for Claude and 4 for Gemini — which typically lands within ±5% of the real API count. We mark those results as estimates instead of pretending they are exact. OpenAI models use the actual BPE vocabulary tables, so those counts match the API.
Does the token count include my system prompt?
Whatever you paste is what gets counted — so paste all of it. Your API bill covers the full request: system prompt, conversation history, tool definitions, and the user message.
How do I turn tokens into dollars?
Cost = (tokens ÷ 1,000,000) × price per 1M tokens. For example, 40,000 input tokens on a model charging $2.50 per 1M input tokens cost $0.10. This page computes the input cost automatically for the selected model; output tokens usually cost 3–5× the input rate.
More tools shipping next
LLM Pricing Comparison, Context Window Comparison, the API Cost Calculator and the Token ↔ Words Converter — all free, all in-browser. Back to all tools