Claude Sonnet 4.6 wins for most use cases: stronger coding benchmarks, better writing quality, a larger context window (1M vs Grok 4's 256K) and a more proven production track record. Grok 4 offered speed and real-time X data, at the same $3/1M input price. xAI retired Grok 4 from its API on May 15, 2026; its current model is Grok 4.7.
xAIBalanced
Grok 4
Retired May 15, 2026 — replaced by Grok 4.6 and Grok 4.7.
VS
AnthropicPremium
Claude Sonnet 4.6
Earlier Sonnet — replaced by Sonnet 5 and then Sonnet 5.5.
Winner
At a glance
Grok 4
Claude Sonnet 4.6
Input cost / 1M tokens
$$3.00/1M
$$3.00/1M
Output cost / 1M tokens
$$15.00/1M
$$15.00/1M
Context window
256k tokens
1M tokens
Speed
Fast
Balanced
Price tier
Balanced
Premium
Benchmarks
SWE-bench (coding)
54%
79.6%
Arena Elo
1,305
1,340
MMLU
87.5%
88.3%
How they compare
Which model wins for each use case — and why.
CodingClaude Sonnet 4.6 wins
Claude Sonnet 4.6 leads SWE-bench at 79.6% and is the default model in Cursor and Windsurf. Grok 4 handles code but trails Claude on the most rigorous coding benchmarks.
WritingClaude Sonnet 4.6 wins
Claude Sonnet 4.6 consistently produces stronger prose — better tone, cleaner structure, and more natural voice. For writing-first workflows, Claude is the clear winner.
Context WindowClaude Sonnet 4.6 wins
Claude Sonnet 4.6 has the larger window: 1M tokens against Grok 4's 256K. Earlier versions of this page said Grok 4 had 2M; that was wrong.
PriceTie
Neither on input: both cost $3/1M input tokens. Output was $15/1M for both as well, so price did not separate them. (Earlier versions of this page listed Grok 4 at $2/$6 in error.)
SpeedGrok 4 wins
Grok 4 is faster than Claude Sonnet 4.6 for most prompt types — a meaningful difference in latency-sensitive applications.
Which should you pick?
Pick Grok 4 if…
Real-time X data matters to your work
You want Grok inside X and its direct, opinionated style
Response latency is a key constraint in your application
You are evaluating xAI — and should look at the current Grok 4.7 instead
For most workflows, Claude Sonnet 4.6 is the stronger choice.
The best all-around model for most developers and writers. Strong SWE-bench, excellent writing, 1M context — all at $3/1M input. Hard to beat as a daily driver.
The case for each model
What each one is genuinely good at, where it falls down, and when we would steer you away from it.
The runner-up here, but not by a wide margin. Against Claude Sonnet 4.6 it answers faster.
xAI's July 2025 flagship, priced at $3/$15 per million tokens with a 256K context window. Retired from xAI's API on May 15, 2026; current Grok models are Grok 4.6 and Grok 4.7.
Input
$3.00/1M
Output
$15.00/1M
Context
256k tokens
Speed
Fast
What people actually use it for
Early-stage research mapping — exploring a new topic before narrowing down
Analyzing codebases and datasets within a 256K-token context window
Competitive intelligence and market research with broad, fast synthesis
Where it wins
Strong coding and reasoning at its July 2025 launch
256K-token context window
Fast and responsive for exploration and open-ended research loops
Where it falls down
Retired from xAI's API on May 15, 2026
Less established ecosystem and tooling than OpenAI or Anthropic
Skip it if
You need the highest writing quality or the most reliable production-grade output — Claude wins both.
Our verdict
Retired: xAI shut down the grok-4-0709 API on May 15, 2026. It was a strong coding model at launch, at $3/$15 with a 256K window; earlier versions of this page listed $2/$6 and 2M tokens in error. Use Grok 4.7 instead.
Full pricing, benchmark table and release notes on the Grok 4 page.
Our overall pick in this comparison. Against Grok 4 it takes 4x the context.
The default model powering Cursor and Windsurf. 79.6% SWE-bench, 1M context window, and best-in-tier writing quality — all at $3/1M input.
Input
$3.00/1M
Output
$15.00/1M
Context
1M tokens
Speed
Balanced
What people actually use it for
Daily coding in Cursor — debugging, refactoring, and feature implementation
Drafting polished client reports, strategy memos, and long-form editorial content
Answering research questions with up to 1M tokens of document context
Where it wins
Strong coding quality with 1M context at $3/1M input
Default model in Cursor and Windsurf, the two most popular AI coding editors
Best writing quality in its price tier — tone, long-form clarity, editorial polish
Where it falls down
Replaced by Claude Sonnet 5 and then Sonnet 5.5, which is stronger and cheaper
GPT-5.5 or GPT-5.4 are better picks when OpenAI computer-use workflows are the priority
Skip it if
You specifically need desktop-control capabilities (GPT-5.5/GPT-5.4) or the absolute highest coding ceiling (Opus 4.7).
Our verdict
The best all-around model for most developers and writers. Strong SWE-bench, excellent writing, 1M context — all at $3/1M input. Hard to beat as a daily driver.
Claude Sonnet 4.6 is stronger for coding and writing. Grok 4's advantages were speed and real-time X data; Claude also had the larger window, at the same price. For everyday developer and content workflows, Claude is the better default.
Which is cheaper — Grok or Claude?
Neither — Grok 4 and Claude Sonnet 4.6 both cost $3/1M input and $15/1M output. Grok 4 has since been retired from xAI's API; its successor Grok 4.7 costs $2/$6.
Is Grok 4 good for coding?
Grok 4 handles coding competently but trails Claude Sonnet 4.6 on SWE-bench and isn't the default in any major AI code editor. For coding-first teams, Claude is the stronger choice.
Which has a bigger context window — Grok or Claude?
Claude Sonnet 4.6, with about 1M tokens against Grok 4's 256K — roughly four times the capacity for very large documents.
Should I switch from Claude to Grok?
Only if context window size, output cost, or speed are your primary bottlenecks. For coding quality and writing, stick with Claude. For large-context analysis at lower cost, Grok 4 is worth testing.