Token Counter

Count exact tokens for OpenAI models, and compare against Claude and Gemini estimates.

A token is the unit a language model actually reads — roughly 4 characters, or about 0.75 words of English. Providers bill per token and cap each request by token count, so the number matters for both cost and whether a prompt fits. This tool counts exactly for GPT models and estimates for Claude and Gemini.

44 characters · 9 words

gpt-4o, gpt-4o-mini, gpt-4.1, gpt-5 and newer

Exact Token Count

…

AI cost workflow

  1. Count tokens
  2. Check it fits
  3. Estimate cost

Found this useful? Share it

X LinkedIn Reddit WhatsApp

About Token Counter

Language models process text as tokens, not characters or words, and every provider bills by token count — so knowing how many tokens your prompt uses matters for both cost and context-window limits. This tool uses the real tiktoken byte-pair-encoding tokenizer (the same library OpenAI publishes) to give an exact count for GPT-4o, GPT-4.1, GPT-5, GPT-4, and GPT-3.5-turbo. Anthropic and Google don't publish an offline tokenizer, so Claude and Gemini counts shown here are estimates based on their own published characters-per-token guidance — clearly labeled as such, never presented as exact. Switch to Compare mode to see how the same text tokenizes across all four side by side, which is useful when deciding which model's context window a document will fit into.

Frequently Asked Questions

OpenAI publishes their tiktoken tokenizer as open source, so this tool can compute the exact byte-pair-encoding token count offline. Anthropic and Google don't publish an equivalent offline library, so those counts use a character-based approximation instead.

Each model family uses its own encoding (vocabulary of byte-pair merges). GPT-4o and newer models use a larger, more efficient vocabulary (o200k_base) than GPT-3.5/GPT-4 (cl100k_base), so the same text often tokenizes to a different count.

It runs your text through all four tokenizers at once — the two exact OpenAI encodings and the two estimate-based ones — so you can see the spread at a glance instead of switching the dropdown repeatedly.

No — tokenization runs entirely in your browser using the tiktoken library. Your text is never uploaded.