Token counter
The same text comes to a different token count in each model. Get exact counts for OpenAI models and estimates for Claude and Gemini, so you can plan for each context window. The text stays in your browser.
Token counts
- GPT-4o, GPT-4.1, GPT-5, o-series0Exact o200k_base
- GPT-4, GPT-3.5, embeddings v30Exact cl100k_base
- Claude Opus 4.7 and later0Estimate characters ÷ 3.5 × 1.3Claude models released before Opus 4.7: 0 (characters ÷ 3.5)Likely too low for this text
- Gemini0Estimate characters ÷ 4Likely too low for this text
o200k_base and cl100k_base are the names of OpenAI's tokenizers: the rules that split text into tokens. Exact counts use those rules. Estimates divide the number of characters by a ratio the provider publishes for English.
Tokens per model
The same text
Text
Before tokenizing
- Characters0
- Words0
- Characters per GPT-4o token-
- GPT-4o tokens per word-
Share of a context window
Using the highest count above
A context window is the most text a model can read at once, counted in tokens. Window sizes differ by model and plan, so check the size in your model's documentation.
The GPT-4o tokens
Each shaded block is one o200k_base token. Spaces belong to the token after them.
How the counts are made
- OpenAI counts are exact. They use js-tiktoken, a JavaScript port of OpenAI's tiktoken. In tiktoken's model list, GPT-4o, GPT-4.1, GPT-5 and the o-series use o200k_base, and GPT-4, GPT-3.5 and the text-embedding-3 models use cl100k_base. Chat requests add a few tokens for message formatting, so an API count can be slightly higher.
- Claude counts are estimates. Anthropic's glossary gives about 3.5 English characters per token for models before Claude Opus 4.7, and its token counting documentation says Claude Opus 4.7 and later produce about 30% more tokens for the same text. The estimate is characters ÷ 3.5 × 1.3. Anthropic does not publish its tokenizer.
- Gemini counts are estimates. Google's token guide says a Gemini token is about 4 characters, and 100 tokens are about 60 to 80 English words. The estimate is characters ÷ 4.
- The estimates hold for English prose. Code, numbers and other languages use more tokens per character.
What are tokens in AI? explains why token counts matter for context windows and retrieval.