Skip to main content

Tokenizer compare: GPT, Claude and Gemini

Compare token counts for the same text: exact OpenAI o200k_base, plus labelled approximate Claude and Gemini estimates. Text never leaves your browser.

Privacy: counting runs in your browser. Text is not uploaded. OpenAI counts use tiktoken (exact). Claude and Gemini are approximate — neither vendor publishes an offline tokenizer.

Paste text to compare token counts.

For costs see the API cost calculator. Cross-check system prompts with the system prompt length checker.

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_base encoding used by GPT-4o and later OpenAI models. Older cl100k_base models 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 countTokens method.
  • 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

  1. Paste text into the box. The OpenAI encoder loads in the background the first time.
  2. Read the three counts, plus characters and words.
  3. 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.

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].

More free tools