Opus 4.7 tokenizer hikes tokens 1.46x, costs 40% more
Claude Opus 4.7's new tokenizer uses 1.46x more tokens than 4.6 for text (e.g., 7,335 vs 5,039 for system prompt), inflating costs ~40% despite unchanged $5/M input, $25/M output pricing. Images scale with resolution; PDFs only 1.08x.
Measure Tokenizer Impact to Control LLM Costs
Claude Opus 4.7 introduces an updated tokenizer that processes text into 1.0–1.35× more tokens than Opus 4.6, per Anthropic—but real tests show up to 1.46× for prompts. Pasting the Opus 4.7 system prompt (from Simon Willison's research repo) into a token counter yields 7,335 tokens on 4.7 vs 5,039 on 4.6—a 1.46× increase. With pricing fixed at $5 per million input tokens and $25 per million output, this makes 4.7 ~40% more expensive for equivalent inputs. Use tools like the upgraded Claude Token Counter (tools.simonwillison.net/claude-token-counter) to compare any Claude model (Opus 4.7/4.6, Sonnet 4.6, Haiku 4.5) via Anthropic's token counting API, revealing exact multipliers vs the lowest count.
Content-Type Drives Token Multipliers
Token inflation varies sharply by input:
- Raw text/system prompts: 1.46× (7,335 vs 5,039 tokens)
- High-res images (e.g., 3,456×2,234 PNG, 3.7MB): Initially 3.01× (4,744 vs 1,578), but this stems from 4.7's expanded support for up to 2,576px long edge (~3.75MP, 3× prior limit). Resize to 682×318px and counts equalize (314 vs 310 tokens).
- PDFs (15MB, 30-page text-heavy): Mild 1.08× (60,934 vs 56,482 tokens)
Test your specific inputs to quantify cost hikes—avoid assuming uniform 1.35× and overbudget by 10-50% on text-heavy workflows.
Practical Tool for Model Comparisons
Simon Willison's open-source Claude Token Counter now supports multi-model runs and image/PDF uploads. GitHub upgrade (simonw/tools#269) leverages Anthropic's API for precise counts across models sharing tokenizers (note: pre-4.7 models align). Input text/images, select models, and get a table of tokens + × vs lowest—e.g., yellow badge for highest (4.7), green for baseline (4.6). This exposes hidden expenses before production, essential for migrating prompts or scaling vision features without surprise bills.