Models··4 min read

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