Free tool
Token Counter
Paste any text to see exactly how many tokens it is for GPT, Claude, and Gemini, plus words, characters, how much of each model's context window it fills, and the cost to send it. The real GPT tokenizer runs in your browser, so nothing is uploaded.
Nothing to count yet
Tokens
0
exact (GPT o200k)
Words
0
whitespace
Characters
0
— chars/token
Token count is exact for GPT (o200k). Gemini and Claude Sonnet 4.6 and earlier tokenize within ~10-15%, so this is a tight estimate for them too. Anthropic says Claude 4.7 and later use a newer tokenizer that produces about 30% more tokens for the same text than the one Claude Sonnet 4.6 and earlier use, and that is its whole current lineup. Treat the Claude figures here as a floor, and use Anthropic's token counting endpoint before you commit to a budget. Everything runs in your browser, and nothing is uploaded.
Model · context fit
Input cost
Input cost = tokens × the model's per-token input price (approximate). Add your expected reply length for the full bill. See the AI Cost Calculator.
Frequently asked
How many tokens is my text?
Paste it above and you'll get the exact count. Tokens are the chunks an AI model reads, roughly 0.75 words or ~4 characters of typical English each, but the real number depends on the exact words, punctuation, code, and language. This tool runs the actual GPT tokenizer (o200k) in your browser, so the token count is exact for GPT models, not an estimate.
Is the token count the same for GPT, Claude, and Gemini?
Close for Gemini, and no longer close for the Claude models you would actually buy. Each model family has its own tokenizer. GPT (o200k) is shown exactly here, and Gemini plus Claude Sonnet 4.6 and earlier tokenize the same English text within roughly 10-15% of that number. Anthropic says Claude 4.7 and later use a newer tokenizer that produces about 30% more tokens for the same text than the one Claude Sonnet 4.6 and earlier use, and that is its whole current lineup. Treat the Claude figures here as a floor, and use Anthropic's token counting endpoint before you commit to a budget.
Why does the token count matter?
Two reasons. First, models have a context window, a maximum number of tokens they can read at once, so a long document may not fit. Second, APIs bill per token, so token count is your cost. This tool shows both: how much of each 2026 model's context window your text uses, and the input cost to send it.
Is my text sent to a server?
No. The tokenizer runs entirely in your browser using JavaScript, so your text never leaves your device and nothing is uploaded, logged, or stored. You can safely paste private prompts, documents, or code.
How do I reduce my token count?
Trim redundant context, remove boilerplate and repeated instructions, summarize long background instead of pasting it whole, and for repeated queries over a large corpus use retrieval (RAG) so you only send the relevant chunks. Tightening a prompt usually cuts both cost and latency without hurting quality.