Token Counter
Count OpenAI tokens locally, or estimate Claude and Gemini. No model API.
Added 2026-10-24
What it does
Token Counter measures text on this page without calling a model API. o200k_base matches GPT-4o, GPT-4.1, the o-series, and the GPT-5 family. cl100k_base matches GPT-4, GPT-3.5, and the common embedding models. Those two encodings split the same sentence differently, especially around Chinese characters. Claude and Gemini use a local estimate: about four UTF-8 bytes per token for Latin text, and one token per CJK, kana, or Hangul character. That estimate can disagree with the provider tokenizer. A context-window figure is a fixed published size used only for comparison, not a live lookup. The text is not sent to a model.
How to use it
- o200k_base matches GPT-4o, GPT-4.1, the o-series, and the GPT-5 family. cl100k_base matches GPT-4, GPT-3.5, and the common embedding models.
- Claude and Gemini are an estimate: about 4 UTF-8 bytes per token for Latin text, and one token per CJK, kana, or Hangul character.
- Pick a context window only to compare the count. The list is a fixed set of published sizes, not a live lookup.
Common mistakes
- An estimate is not the model tokenizer. Claude and Gemini counts on this page are a local formula. They can differ from the provider's own count.
- The same sentence is a different length in each encoding. o200k_base and cl100k_base split text differently, especially around Chinese characters.
The text stays in this tab. Counting uses a tokenizer bundled with the page. It is not sent to a model.
Related guides
- Count tokens without a model API
o200k_base and cl100k_base count OpenAI tokens locally. Claude and Gemini here are estimates. Chunk overlap is repeated context.