Skip to content

Token counter

Paste any text and see how many tokens it uses in OpenAI GPT, Anthropic Claude and Google Gemini models, with characters, words, lines and context window fit. The count updates as you type.

Runs in your browser. Your text stays on your device.

Counted in your browser. The text never leaves this device: no upload, no storage, no analytics.

Results

No text.

Characters

0

Words

0

Lines

0

Tokens by model family

  • OpenAI GPT Exact

    0

    Exact for the o200k_base encoding, which OpenAI's open-source tokenizer uses for its recent GPT and o-series models.

  • Anthropic ClaudeEstimate

    ≈ 0

    Estimate: about 2.7 characters per token for current Claude models, from Anthropic's published figures.

  • Google GeminiEstimate

    ≈ 0

    Estimate: about 4 characters per token, the rule that Google publishes for Gemini.

  • Other modelsEstimate

    ≈ 0

    Range: 3 to 4 characters per token. Llama, Mistral, DeepSeek, Grok and others each use their own tokenizer.

Context window fit

Uses the highest count above. Leave room for the answer.

  • 32K tokensFits, 0% used
  • 128K tokensFits, 0% used
  • 200K tokensFits, 0% used
  • 1M tokensFits, 0% used

Counting tokens before you send them is step one

See which feature of your product spends them in production. AI Cost Map labels each AI call with a feature and shows the token cost of each one.

How the counts work

Every provider has its own tokenizer. Of these three providers, only OpenAI publishes the tokenizer of its current models in a form that runs in a browser. So the page shows one exact count and clearly marked estimates.

  • OpenAI GPTExact

    The page runs the o200k_base encoding from OpenAI's open-source tiktoken library (with the gpt-tokenizer package) on your device.

  • Anthropic ClaudeEstimate

    Anthropic gives about 3.5 English characters per token for earlier Claude models, and about 30% more tokens on the newer tokenizer of current models. That is about 2.7 characters per token.

  • Google GeminiEstimate

    Google gives about 4 characters per token for Gemini models, and 100 tokens for about 60 to 80 English words.

  • Chinese, Japanese, Korean and emojiEstimate

    These characters carry more information per character, so the estimates count each one as about one token (1.3 for Claude).

To turn a token count into a price, compare input and output prices per 1M tokens on the LLM model prices page.

Questions about tokens

What is a token?

A token is the unit a language model reads and writes. A tokenizer cuts text into pieces from a fixed vocabulary: a common word is often one token, a rare word is split into several, and a space or a punctuation mark can be part of a token. Providers bill and limit requests in tokens, not in words or characters.

How many words is 1,000 tokens?

For English prose, 1,000 tokens are roughly 600 to 800 words. Google gives 100 tokens ≈ 60 to 80 English words for Gemini. Anthropic says one token is about 3.5 English characters on earlier Claude models, and that current Claude models produce about 30% more tokens for the same text. Code, numbers, URLs, JSON and most languages other than English use more tokens per word.

Why do OpenAI, Claude and Gemini give different counts for the same text?

Each provider trains its own tokenizer with its own vocabulary. A word that is one token in one vocabulary can be two or three tokens in another, so the same prompt has a different count for each model family. The count can also change between model generations of one provider, when the provider changes its tokenizer.

Which counts are exact and which are estimates?

The OpenAI count is exact for the o200k_base encoding: the page runs the same encoding as OpenAI's open-source tiktoken library, in your browser. If OpenAI ships a model with a new encoding, that model's count can differ. Anthropic and Google do not publish a tokenizer for their current models that can run in a browser, so the Claude and Gemini numbers are estimates from the characters-per-token figures that the providers publish. The real count can be higher or lower, most of all for code, numbers and text that is not English.

How do I get an exact Claude or Gemini count?

Use the provider's token counting API with the model you plan to call. Anthropic has a free count_tokens endpoint, and the Gemini API has countTokens. After a call, the usage data in the response gives the exact input and output tokens. Chat requests also add a few tokens per message for roles and formatting, and images, files and tool definitions count separately.

Does my text leave my browser?

No. The counting runs in a Web Worker on your device. The page sends no request with your text, does not store it, and has no analytics on it. Spell check is off in the text box, because the enhanced spell check of some browsers sends text to a server. To check this, open the Network tab of your browser's developer tools while you type: the only download is the tokenizer data, one time, and it carries no text.

What is a context window?

The context window is the maximum number of tokens that a model can take in one request: the system prompt, the conversation, any documents and the answer that the model writes. If the bars show that your text fills most of a window, leave room for the answer, or split the document.

How do I see the token usage of each feature in production?

Counting tokens before you send them tells you the size of one prompt. In production, many features call the model many times a day. AI Cost Map wraps your AI client, labels each call with a feature, and shows the token cost of each feature. It sends token counts and labels only: your prompts stay on your servers.

Want to know where your tokens go after launch? AI Cost Map shows AI cost per feature.