Paste text and compare how many tokens it uses for OpenAI, Claude and Gemini models. The OpenAI count is exact; the Claude and Gemini counts are approximate, clearly labelled.
How it works
- OpenAI (exact): counted with js-tiktoken using the
o200k_baseencoding used by GPT-4o and later OpenAI models. Oldercl100k_basemodels are not counted here. - Gemini (approximate): Google’s documentation says a token is about 4 characters, so we divide the character count by 4. For an exact figure, use the Gemini API’s
countTokensmethod. - Claude (approximate): Anthropic does not publish an offline tokenizer, and its own token-counting endpoint describes the result as an estimate. Our figure is a labelled heuristic of about 3.5 characters per token. For an exact figure, use Anthropic’s token-counting API.
How to use
- Paste text into the box. The OpenAI encoder loads in the background the first time.
- Read the three counts, plus characters and words.
- Click Clear when done.
Limits
Chat formatting, system messages and tool definitions add tokens that are not counted here. No prices are shown; use the API cost calculator for costs.
Related
OpenAI tokenizer · Token counter · System prompt length checker · LLM API pricing
How we check
Vendor tokenizer statements re-checked against Google’s Gemini token docs and Anthropic’s token-counting docs. Checked against the tool’s unit tests and a manual run in a desktop browser on 2026-11-13 (Asia/Colombo). Corrections: [email protected].