How to Count Tokens for GPT, Claude and Gemini
Why token counts differ between models, how to estimate them quickly, and how to use a token counter before sending prompts.
Different tokenizers
OpenAI, Anthropic and Google each use their own tokenizer. English prose usually lands within a modest margin across them; code, numbers and other languages vary more.
Count in your browser
The Token Counter uses a modern GPT tokenizer locally, so you can paste confidential text safely and get an instant count, plus estimates for planning.
Leave headroom
Remember the model's answer also uses tokens. If your input fills the whole window, the reply gets cut short. Keep a comfortable buffer for output.
Try it free in your browser
- Token Counter — Live token, character, and context-window meter for any prompt. Uses official tiktoken encoders.
Tools mentioned
Frequently asked
Why do counts differ between models?
Each provider trains its own tokenizer, splitting text differently, especially for code and non-English text.
Is an estimate good enough?
For planning context and costs, yes. Leave some margin when you are close to a limit.
Keep reading
How to Prepare PDFs for ChatGPT, Claude, and Gemini
A practical guide to extracting clean, AI-ready text from PDFs — born-digital and scanned — so ChatGPT, Claude, and Gemini answer accurately and don't waste tokens on headers, footers, and page numbers.
The Best Way to Feed Long Documents to Claude (and Other Long-Context Models)
Claude's 200K-token context is generous, but you'll still want to clean, compress, and structure long documents before sending them. Here's a step-by-step playbook.
Cleaning Whisper Transcripts for AI Summaries
OpenAI Whisper, Otter, and YouTube transcripts are full of timestamps, filler words, and speaker noise. Here's how to strip them before sending to ChatGPT or Claude — and why it matters.