Claude Token Counter, now with model comparisons

📰 Simon Willison's Blog

Learn how to compare token counts across different Claude models using Simon Willison's token counter tool and understand the implications of token inflation on pricing

intermediate Published 20 Apr 2026
Action Steps
  1. Use the Claude Token Counter tool to compare token counts across different models
  2. Upload text or images to the tool to get token counts
  3. Compare the token counts and pricing implications between different models like Opus 4.7 and 4.6
  4. Test the tool with different input types, such as text and images, to see the variations in token counts
  5. Analyze the results to understand the impact of token inflation on your costs
Who Needs to Know This

Developers and data scientists working with LLMs can benefit from this tool to optimize their model usage and costs

Key Insight

💡 Token inflation in newer models like Opus 4.7 can lead to higher costs despite the same pricing as older models

Share This
🤖 Compare token counts across Claude models with Simon Willison's token counter tool and optimize your LLM usage! 💡

Key Takeaways

Learn how to compare token counts across different Claude models using Simon Willison's token counter tool and understand the implications of token inflation on pricing

Full Article

Title: Claude Token Counter, now with model comparisons

URL Source: https://simonwillison.net/2026/Apr/20/claude-token-counts/

Published Time: Mon, 20 Apr 2026 00:54:07 GMT

Markdown Content:
# Claude Token Counter, now with model comparisons

# [Simon Willison’s Weblog](https://simonwillison.net/)

[Subscribe](https://simonwillison.net/about/#subscribe)

**Sponsored by:** Honeycomb — AI agents behave unpredictably. Get the context you need to debug what actually happened. [Read the blog](https://fandf.co/4sb46pb)

20th April 2026 - Link Blog

**[Claude Token Counter, now with model comparisons](https://tools.simonwillison.net/claude-token-counter)**. I [upgraded](https://github.com/simonw/tools/pull/269) my Claude Token Counter tool to add the ability to run the same count against different models in order to compare them.

As far as I can tell Claude Opus 4.7 is the first model to change the tokenizer, so it's only worth running comparisons between 4.7 and 4.6. The Claude [token counting API](https://platform.claude.com/docs/en/build-with-claude/token-counting) accepts any Claude model ID though so I've included options for all four of the notable current models (Opus 4.7 and 4.6, Sonnet 4.6, and Haiku 4.5).

In the Opus 4.7 announcement [Anthropic said](https://www.anthropic.com/news/claude-opus-4-7#migrating-from-opus-46-to-opus-47):

> Opus 4.7 uses an updated tokenizer that improves how the model processes text. The tradeoff is that the same input can map to more tokens—roughly 1.0–1.35× depending on the content type.

I pasted the [Opus 4.7 system prompt](https://github.com/simonw/research/blob/2cf912666ba08ef0c00a1b51ee07c9a8e64579ef/extract-system-prompts/claude-opus-4-7.md?plain=1) into the token counting tool and found that the Opus 4.7 tokenizer used 1.46x the number of tokens as Opus 4.6.

![Image 1: Screenshot of a token comparison tool. Models to compare: claude-opus-4-7 (checked), claude-opus-4-6 (checked), claude-opus-4-5, claude-sonnet-4-6, claude-haiku-4-5. Note: "These models share the same tokenizer". Blue "Count Tokens" button. Results table — Model | Tokens | vs. lowest. claude-opus-4-7: 7,335 tokens, 1.46x (yellow badge). claude-opus-4-6: 5,039 tokens, 1.00x (green badge).](https://static.simonwillison.net/static/2026/claude-token-count.jpg)

Opus 4.7 uses the same pricing is Opus 4.6 - $5 per million input tokens and $25 per million output tokens - but this token inflation means we can expect it to be around 40% more expensive.

The token counter tool also accepts images. Opus 4.7 has improved image support, described like this:

> Opus 4.7 has better vision for high-resolution images: it can accept images up to 2,576 pixels on the long edge (~3.75 megapixels), more than three times as many as prior Claude models.

I tried counting tokens for a 3456 × 2234 pixel 3.7MB PNG and got an even bigger increase in token counts - 3.01x times the number of tokens for 4.7 compared to 4.6:

![Image 2: Same UI, this time with an uploaded screenshot PNG image. claude-opus-4-7: 4,744 tokens, 3.01x (yellow badge). claude-opus-4-6: 1,578 tokens, 1.00x (green badge).](https://static.simonwillison.net/static/2026/claude-token-count-image.jpg)

Posted [20th April 2026](https://simonwillison.net/2026/Apr/20/) at 12:50 am

## Recent articles

* [Changes in the system prompt between Claude Opus 4.6 and 4.7](https://simonwillison.net/2026/Apr/18/opus-system-prompt/) - 18th April 2026
* [Join us at PyCon US 2026 in Long Beach - we have new AI and security tracks this year](https://simonwillison.net/2026/Apr/17/pycon-us-2026/) - 17th April 2026
* [Qwen3.6-35B-A3B on my laptop drew me a better pelican than Claude Opus 4.7](https://simonwillison.net/2026/Apr/16/qwen-beats-opus/) - 16th April 2026

This is a **link post** by Simon Willison, posted on [20th April 2026](https://simonwillison.net/2026/Apr/20/).

[ai 1969](https://simonwillison.net/tags/ai/)[generative-ai 1746](https://simonwillison.net/tags/generative-ai/)[ll
Read full article → ← Back to Reads

Related Videos

5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)
I Built a CLI in One Afternoon That Unlocks Higgsfield's Hidden Capabilities
I Built a CLI in One Afternoon That Unlocks Higgsfield's Hidden Capabilities
Kevin Farugia AI Automation
Airtable Just Released an MCP Server — Here's How to Use It with Claude
Airtable Just Released an MCP Server — Here's How to Use It with Claude
Kevin Farugia AI Automation
I Tried Google's Anti-Gravity IDE So You Don't Have To
I Tried Google's Anti-Gravity IDE So You Don't Have To
Kevin Farugia AI Automation
I Started Building a GoHighLevel Clone Using Claude Code on My Phone
I Started Building a GoHighLevel Clone Using Claude Code on My Phone
Kevin Farugia AI Automation
🔥MAJOR CHATGPT UPDATE.🔥
🔥MAJOR CHATGPT UPDATE.🔥
Alicia Lyttle