Free tool, no signup

Token counter for Claude, GPT and Gemini.

Paste a prompt, a document or a tool result. Get the token count on each provider and what that text costs as input or output on every current model, from the same list prices Agent Ping bills runs with.

Your textNothing is stored
TokensPer provider
Claudeestimate0
OpenAI GPTloading the tokenizer0
Geminiestimate, about 4 characters a token0
Characters0
Words0

OpenAI is counted in your browser with o200k_base. Claude is an estimate on this deployment. Gemini is an estimate; use the Gemini API's countTokens for the exact figure.

Tokens to dollars

What this text costs on each current model, as a prompt (input) and as a model answer (output), at list price per million tokens verified 17 October 2026. The Claude rows use the Claude count, the GPT rows the OpenAI count, the Gemini rows the Gemini estimate.

Model Provider Per 1M in / out This text as input This text as output
Claude Opus 5.5claude-opus-5-5 Claude $4 / $20 $0 $0
Claude Sonnet 5.5claude-sonnet-5-5 Claude $2 / $10 $0 $0
Claude Haiku 5.5claude-haiku-5-5 Claude $0.1 / $0.5 $0 $0
GPT-5.5gpt-5.5 OpenAI $5 / $30 $0 $0
GPT-5.4gpt-5.4 OpenAI $2.5 / $15 $0 $0
GPT-5 Nanogpt-5-nano OpenAI $0.05 / $0.4 $0 $0
Gemini 3.1 Pro Previewgemini-3.1-pro-preview Gemini $2 / $12 $0 $0
Gemini 3.8 Flashgemini-3.8-flash Gemini $0.75 / $3.75 $0 $0
Gemini 3.5 Flash-Litegemini-3.5-flash-lite Gemini $0.3 / $2.5 $0 $0

Every model and provider, with cached-input and batch rates, is on the LLM API pricing comparison. To price a whole month of runs rather than one prompt, use the token cost calculator.

How each count is produced

Three providers, three tokenizers, and only one of them is public. Here is exactly what each number on this page is.

Claude token counter

Anthropic does not publish the Claude tokenizer, so there is no way to count Claude tokens exactly offline. This deployment shows an estimate at about 3.5 characters a token, Anthropic's own rule of thumb for English; the exact figure comes from the count_tokens endpoint. All current Claude models share a tokenizer, so the count is the same for Haiku, Sonnet and Opus; only the price per token changes.

OpenAI GPT token counter

OpenAI publishes its encodings in tiktoken. This page runs o200k_base, the encoding used by GPT-4o, GPT-4.1, GPT-5 and the o-series, in your browser with the gpt-tokenizer library, so the count is exact for those models and your text never leaves the page. Older GPT-4 and GPT-3.5 models used cl100k_base and will count slightly differently. Whatever the model, the usage object in the API response is the billed figure.

Gemini token counter

Google documents that a Gemini token is about four characters of English text, or roughly 60 to 80 words per 100 tokens, and provides a countTokens method for exact figures. This page shows the four-characters estimate. It runs high on prose and low on code, so treat it as a budget figure and read the usageMetadata on a real response for the number you will be charged.

Questions

How does this token counter work for each provider?

OpenAI counts are exact and run in your browser using o200k_base, the encoding OpenAI publishes in tiktoken for GPT-4o, GPT-4.1, GPT-5 and the o-series. Claude counts come from Anthropic's count_tokens API, because Anthropic does not publish its tokenizer; your text is forwarded to Anthropic for counting and not stored. Gemini counts are an estimate at about four characters a token, which is Google's own rule of thumb; the exact figure comes from the countTokens method of the Gemini API.

Why do Claude and GPT give different token counts for the same text?

Each provider trains its own tokenizer on its own data, so the same sentence splits differently. Claude's tokenizer usually produces a few percent more tokens than o200k_base on English prose, and the gap widens on code, JSON and non-English text. Since you pay per token, the same prompt has a different price on each provider even before the per-million rate is applied.

How many words is a token?

Roughly three quarters of an English word: 100 tokens is about 75 words, and 1,000 words is about 1,300 to 1,400 tokens. Punctuation, whitespace, numbers and code tokenise less efficiently, and most non-English languages need more tokens per word.

Is my text stored?

No. The OpenAI count never leaves your browser. For the exact Claude count the text is sent to our server and on to Anthropic's count_tokens endpoint, which returns a number; we do not log or keep the text. If you prefer, use the estimate and never send anything.

How do I count tokens in code?

OpenAI: the tiktoken library (Python) or gpt-tokenizer (JavaScript) with o200k_base. Anthropic: POST /v1/messages/count_tokens with the model and messages. Gemini: the countTokens method in the Google GenAI SDK. For billing, read the usage object in every API response rather than counting beforehand; that is the number the invoice is built from, and it is what Agent Ping prices each run with.

Counting one prompt is easy. Counting a month of them is the job.

Agent Ping reads the usage block on every real call your agents make, prices it from the same rate card as this page, and tells you what each agent, customer and feature cost, with a page when one of them spikes.

Free plan, no card required.