AI EngineerGuide

Claude token counter

Estimate Claude tokens for your prompt, including the newer Claude 4.7+ tokenizer, and see what it costs.

Runs in your browser. Nothing you paste is uploaded.

Or drop a .txt, .md or .json file here, or . It's read in your browser.

299 characters Β· 53 words

Token counts by tokenizer
TokenizerTokensTypeUsed by
Claude 4.7 and later112estimate characters Γ· 3.5 Γ— 1.3Opus 4.7+, Sonnet 5.x, Haiku 5.5, Fable, Mythos
Claude before 4.786estimate characters Γ· 3.5Sonnet 4.5/4.6, Haiku 4.5, Opus 4.6 and earlier
OpenAI o200k_base73exact Exact (gpt-tokenizer 4.1.0)GPT-4o, GPT-4.1, GPT-5.x, GPT-6, o-series
OpenAI cl100k_base75exact Exact (gpt-tokenizer 4.1.0)GPT-4, GPT-4 Turbo, GPT-3.5 Turbo, text-embedding-3
Gemini75estimate characters Γ· 4Gemini API models

Pick a model to see what these tokens cost as input or output, and how much of its context window they use.

View OpenAI tokens

Each colored block is one token. Only the first 2,000 tokens are shown.

The OpenAI counts for the sample text are already filled in. The two OpenAI tokenizer files (about 1.5 MB compressed) load the first time you edit the text.

How to use it

  1. Paste your prompt or drop a text file.
  2. Use the Claude 4.7 and later row for Opus 4.7+, Sonnet 5.x, Haiku 5.5, Fable and Mythos, and the other Claude row for older models.
  3. Pick a Claude model to see input and output cost and context window use.

How we estimate Claude tokens

For Claude models before 4.7 we divide the character count by 3.5, from Anthropic’s glossary. For Claude 4.7 and later we multiply that by 1.3, because Anthropic’s token counting docs say the newer tokenizer “produces approximately 30 percent more tokens”. Both checked 2026-11-02.

These ratios hold for English prose. Code, JSON and other languages usually produce more tokens, so treat the estimate as a lower bound and leave headroom. Tool definitions, system prompts and images also add tokens. For exact numbers use Anthropic’s free token counting endpoint.

FAQ

How many tokens does Claude use per word?

On Claude models before 4.7, a token is about 3.5 English characters, according to Anthropic’s glossary. Claude 4.7 and later models use a newer tokenizer that produces about 30% more tokens for the same text.

Why does the same prompt cost more tokens on newer Claude models?

Claude Opus 4.7 introduced a new tokenizer, shared by later models. Anthropic says the same input produces approximately 30 percent more tokens, so recount prompts before you compare costs or check context fit.

Is this an exact Claude token count?

No. Anthropic doesn’t publish a browser tokenizer, so this is an estimate. For an exact count, call the free /v1/messages/count_tokens endpoint with the model you plan to use.

Do tool definitions and images count toward Claude's input tokens?

Yes. Tools, the system prompt and images all add input tokens, and this counter only measures the text you paste. Anthropic’s token counting endpoint accepts the same inputs as a message request, including the system prompt, tools, images and PDFs.