Anthropic offers a count_tokens API endpoint, but using it requires an API key and a code call. For one-off counts — like checking whether your prompt fits or estimating cost before sending — a free browser-based counter is faster.
No API key, no signup, no install. The counter runs entirely in your browser — your prompt never leaves your device, which matters for confidential or proprietary content.
Count tokens for Claude prompts in your browser.
Open Token Counter →| Model | Input ($/M) | Output ($/M) | Context window |
|---|---|---|---|
| Claude Haiku 3.5 | $0.80 | $4.00 | 200,000 tokens |
| Claude Sonnet 4 | $3.00 | $15.00 | 200,000 tokens |
| Claude Opus 4 | $15.00 | $75.00 | 200,000 tokens |
All Claude models share the same 200K context window. The pricing tier determines quality and cost, not capacity.
| Prompt type | Approximate tokens | Cost on Sonnet 4 |
|---|---|---|
| Short question (10 words) | 13 input | $0.00004 input |
| Detailed prompt (100 words) | 130 input | $0.0004 input |
| Long instruction (500 words) | 650 input | $0.002 input |
| 1-page document (250 words) | 325 input | $0.001 input |
| 5-page document (1,250 words) | 1,625 input | $0.005 input |
| 20-page document (5,000 words) | 6,500 input | $0.020 input |
| Full novel (50,000 words) | 65,000 input | $0.195 input |
Claude handles a full novel as input for under 20 cents on Sonnet 4. The output cost depends on what you ask Claude to generate from it.
Browser counters give a word-based approximation. Anthropic's count_tokens API gives the exact count using Claude's actual tokenizer. For English prose, the two agree within 5%. For code and special characters, the variance is larger (5-15%).
For estimation and context window checks, the approximation is fine. For exact billing math, use the official API count.
Use the browser counter when you:
Use the Anthropic count_tokens API when you:
Anthropic's count_tokens API requires sending your text to Anthropic's servers. For most use cases, that's fine. For confidential text — legal contracts, internal HR documents, source code, customer data — you may not want to send it anywhere.
Browser-based token counters run locally. Your text is processed in your browser's JavaScript engine. Nothing is uploaded, logged, or stored. The result is the same approximate count without the privacy trade-off.
Count Claude tokens privately in your browser. No upload, no signup.
Open Token Counter →