New blogMaking an AI Agent You Can Trust With Money

★ Claude · token counter

Claude Token Counter

Anthropic doesn't publish Claude's tokenizer, so no browser tool can count Claude tokens exactly. This page gives a clearly labelled estimate, the input cost per call on each current Claude model, and how much of the context window you're using.

  • Runs in your browser
  • No signup
306
Characters
54
Words
—
Tokens / word

Tokens per word uses the o200k_base count. Characters count emoji and accented letters as one each.

Tokens

…

≈ Estimate

Estimated with o200k_base as a stand-in. Claude's own tokenizer isn't available in the browser.

Context window used

—

1M tokens window on Claude Sonnet 5.5.

Input cost per call

—

Per 1,000 calls

—

Every model, same text

ModelTokensAccuracyInput / call
Claude Fable 5.1Anthropic…≈ Estimate—
Claude Opus 5.5Anthropic…≈ Estimate—
Claude Sonnet 5.5Anthropic…≈ Estimate—
Claude Haiku 5.5Anthropic…≈ Estimate—
GPT-6 AstraOpenAI…✓ Exact—
GPT-6.1 SolOpenAI…✓ Exact—
GPT-6 LunaOpenAI…✓ Exact—
Gemini 4 ArgonGoogle77≈ Estimate$0.00015
Gemini 3.8 FlashGoogle77≈ Estimate$0.00006
Gemini 3.1 Flash-LiteGoogle77≈ Estimate$0.00002
Mistral Large 4Mistral…≈ Estimate—
Mistral Small 4Mistral…≈ Estimate—
DeepSeek V4.1 FlashDeepSeek92≈ Estimate$0.00003
DeepSeek V4 ProDeepSeek92≈ Estimate$0.00012
Llama (open weights)Meta…≈ Estimate—

OpenAI rows use o200k_base, exact for that tokenizer. tiktoken hasn't mapped GPT-6 model names yet, so OpenAI hasn't confirmed GPT-6 uses it. Input cost is list price for your text alone, before system prompts, caching or output.

See the tokens

o200k_base

Loading the tokenizer…

Your tokens on Claude Sonnet 5.5.

Prompts eating your context window? I build RAG and prompt pipelines that use a fraction of the tokens.

Shrink my prompts
01

How Claude tokenizes

Claude uses its own byte-level tokenizer, and Anthropic doesn't ship it as a library. The only exact source is Anthropic's token-counting endpoint, which needs an API key and returns the count for a specific model.

Tokenizers also change between model generations, so the same text can produce a different count on a newer Claude model than on an older one. Count with the model you will actually call.

02

Exact or estimate?

Estimate. We count your text with o200k_base, a modern 200k-vocabulary tokenizer, and use that as a stand-in. Claude's tokenizer is different, so treat the number as a ballpark, not a bill.

For an exact number, call Anthropic's count_tokens endpoint with the model you plan to use. Anthropic's docs describe it as free to use, subject to its own rate limits, and note that even its count can differ slightly from the final billed input.

03

Current Claude models

Context windows and input prices from the pricing data used across these tools.

Claude models
ModelContext windowInput / 1M
Claude Fable 5.1Not published$10
Claude Opus 5.51M tokens$4
Claude Sonnet 5.51M tokens$2
Claude Haiku 5.51M tokens$0.10
04

Quirks worth knowing

  • Code, JSON and non-English text usually take more tokens per character than plain English prose. That holds for Claude too.
  • System prompts, tool definitions and images all count as input tokens on top of your message text.
  • If you are close to a budget, leave headroom: an estimate can be off in either direction.

Sources: Claude docs: Token counting

05

Questions people actually ask

Can I count Claude tokens exactly in the browser?
No. Anthropic doesn't publish Claude's tokenizer as a library, so exact counts come from Anthropic's count_tokens API endpoint. This page shows a labelled estimate instead.
Do all Claude models count tokens the same way?
Not necessarily. Tokenizers change between model generations, so the same text can produce different counts on different Claude models. Count with the exact model you plan to use.
Is the count_tokens endpoint free?
Anthropic's docs say token counting is free to use, subject to requests-per-minute limits based on your usage tier.
Which counts on this page are exact?
OpenAI rows are exact for o200k_base, OpenAI's published tokenizer, counted in your browser. Gemini rows are exact when this site's server has a Gemini key and Google's countTokens endpoint answers. Claude, Llama, DeepSeek and Mistral rows are estimates, and each says how it was made.
Is my text sent anywhere?
The o200k_base count runs entirely in your browser. Only if you edit the text (or ask for it) is the text sent to Google's countTokens endpoint through this site's server for exact Gemini counts, and nothing is stored or logged here.
06

Count by model family

07

More from the workbench

Fine print

Tools: on the house.
Engineer: by the hour.

Counting tokens was free. Spending fewer of them is a project.

I'm Himanshu, an AI and full-stack engineer. I build MVPs, AI agents and the growth plumbing around them for early-stage startups.