Paste your text
📝
Paste text above to see the token count and cost estimate.
Got a Claude Code session log?
Drop your .jsonl file for an exact cost breakdown by model, tool, and hour — with real cache savings data.
How Claude tokenization works
Claude uses a Byte-Pair Encoding (BPE) tokenizer — the same family as GPT-4's cl100k_base. The key rules:
- Common English words are usually 1 token (e.g. "the", "hello", "function")
- Longer or uncommon words split into 2–4 tokens (e.g. "tokenization" → 3 tokens)
- Code tokens are denser — whitespace, braces, and operators each cost a token
- Numbers often split character-by-character in long strings
- Non-English scripts (CJK, Arabic) can be 2–6× more expensive per word than English
- On average: ~4 chars = 1 token for English prose; ~3 chars = 1 token for code
2026 Claude API pricing reference
| Model | Input / M tokens | Output / M tokens | Cache read / M | Context |
|---|---|---|---|---|
| Haiku 4.5 | $0.80 | $4.00 | $0.08 | 200K |
| Sonnet 4.6 | $3.00 | $15.00 | $0.30 | 200K |
| Opus 4.7 | $15.00 | $75.00 | $1.50 | 200K |
Cache write adds 25% to the first input pass but is free on subsequent reads. Prices current as of May 2026.
Frequently asked questions
How many tokens is 1000 words in Claude?
A typical 1,000-word English document contains approximately 1,200–1,400 tokens in Claude. The ratio is roughly 1.3 tokens per word for standard prose. Technical writing with lots of jargon, numbers, or non-English terms can push that higher — towards 1.5–2 tokens per word.
How do I count tokens exactly (not an estimate)?
Use Anthropic's official
POST /v1/messages/count_tokens endpoint. Pass your model, system prompt, and messages — it returns the exact token count before you spend any money. In Python: client.messages.count_tokens(model="claude-sonnet-4-6", messages=[...]). This is free and doesn't count against your API budget.Does Claude count tokens the same way as GPT-4?
They are very similar — both use BPE tokenizers trained on large text corpora. In practice, token counts for the same English text are within 1–5% of each other. The biggest divergence is in code and non-English text, where Anthropic's tokenizer can differ more. You cannot use tiktoken's cl100k_base results interchangeably with Claude's counts for billing purposes; always use the Anthropic token-count endpoint for exact numbers.
Why does code cost more tokens than prose?
Code is tokenized at a lower compression ratio than English text. Every whitespace indent, curly brace, semicolon, and operator is typically its own token. A 1,000-character Python function might use 400–500 tokens, while 1,000 characters of English prose uses 250–300. This is why long system prompts containing code snippets can push your context costs up faster than expected.
What is a token in the context of Claude's pricing?
Anthropic charges per token — a token is roughly 4 characters of English text. Your prompt and Claude's response are both tokenized; you pay for both. Input tokens include everything you send: the system prompt, conversation history, and your current message. Output tokens are the characters Claude generates in reply. Cache-read tokens (from prompt caching) are billed at 90% less than fresh input tokens.
How can I reduce my Claude token usage?
The biggest wins are: (1) prompt caching — if you reuse the same system prompt across calls, Anthropic caches it and charges only 10% of input price for cache reads; (2) truncating context — don't send the full conversation history when only recent turns are relevant; (3) using Haiku for simple tasks — it's 15–20× cheaper per token than Opus; (4) compressing documents before sending — summarize or extract only the relevant sections. See our full cost-reduction guide.
Is this token counter free and private?
Yes — fully free, no account required. All counting runs in your browser with JavaScript. Your text is never sent to any server. The only external request is a 1×1 visitor-count pixel (abacus.jasoncameron.dev) that helps us track traffic — it does not receive your text.