LLMBenchmark.ai

Enter opens the highlighted result. Esc closes.

Claude Sonnet 4.6 vs Gemma 4 31B

Updated October 21, 2026. 65 benchmarks have a result for both. Coding is ranked on the Vibe Coding Index; every other board is shown as published.

Claude Sonnet 4.6Anthropic
Coding
57.8
Overall
30.1
Output $/M
$15.00
57
Gemma 4 31BGoogle
Coding
38.3
Overall
14.7
Output $/M
$0.40
8
vs boards won of 65 shared

Decision reading

Pick Claude Sonnet 4.6 for coding: it scores 57.8 on the Vibe Coding Index against 38.3 for Gemma 4 31B.

Pick Gemma 4 31B when output tokens cost 37.5x less, or when what matters is LMArena Text: math or SAGE (Vals AI), where it leads.

Shared results
65
Claude Sonnet 4.6 only
52
Gemma 4 31B only
3
Like-for-like categories
8 of 9

Shared results can support a head-to-head reading. Results only one model has describe coverage, not superiority.

Which one for your work

Each card is decided by one number both models carry. Where only one has it, the card says so and makes no call.

At a glance

Coding index
Claude Sonnet 4.6 57.8 from 2 benchmarks, Gemma 4 31B 38.3 from 2 benchmarks.
Widest category
Agentic work, 26.9 points apart on average over 5 shared benchmarks.
Widest single gap
LiveBench browser: Claude Sonnet 4.6 68.0% against Gemma 4 31B 4.0%, 64.0 points apart on a 0 to 100 scale.
Output price
Claude Sonnet 4.6 $15.00 against Gemma 4 31B $0.40 per million output tokens, 37.5x apart.
Context window
Claude Sonnet 4.6 takes 1M tokens, Gemma 4 31B 262K.

Benchmark by benchmark

First the score: boards each model leads, per category, where both have a result. Then every board, a category to a fold; bars are each result on a 0 to 100 scale, so compare the two in a row, not one row with another.

Boards won, where both have a result
CategoryClaude Sonnet 4.6BarsGemma 4 31BTies
Coding100
Intelligence20
Agentic work50
Reasoning90
Math21
Knowledge70
Web design10
General217
All shared boards578
CodingLike-for-likeFour of these boards feed the Vibe Coding Index100
Coding benchmarks for Claude Sonnet 4.6 and Gemma 4 31B
BenchmarkClaude Sonnet 4.6Gemma 4 31BLeader
LiveBench coding66.6%49.0%Claude Sonnet 4.6
LMArena WebDev15231367Claude Sonnet 4.6
AA Coding Index63.043.4Claude Sonnet 4.6
LiveCodeBench (Vals AI)82.1%Not measuredOnly Claude Sonnet 4.6 measured
SWE-bench Verified (Vals AI)77.4%Not measuredOnly Claude Sonnet 4.6 measured
Vibe Code Bench (Vals AI)55.8%Not measuredOnly Claude Sonnet 4.6 measured
Code migration (Vals AI)39.9%Not measuredOnly Claude Sonnet 4.6 measured
ProgramBench (Vals AI)0.5%Not measuredOnly Claude Sonnet 4.6 measured
Terminal-Bench 2.1 (Vals AI)57.3%Not measuredOnly Claude Sonnet 4.6 measured
SkillsBench (Vals AI)49.0%Not measuredOnly Claude Sonnet 4.6 measured
SciCode50.1%45.5%Claude Sonnet 4.6
Terminal-Bench Hard (Artificial Analysis run)53.0%36.4%Claude Sonnet 4.6
Terminal-Bench53.4%Not measuredOnly Claude Sonnet 4.6 measured
FrontierCode24.3%Not measuredOnly Claude Sonnet 4.6 measured
WeirdML66.1%52.3%Claude Sonnet 4.6
ALE-BenchNot measured925.5Only Gemma 4 31B measured
LMArena Text: coding15031459Claude Sonnet 4.6
LMArena Text: software and IT14911463Claude Sonnet 4.6
LMArena WebDev: React15121359Claude Sonnet 4.6
LMArena WebDev: HTML15271380Claude Sonnet 4.6
LMArena WebDev: from an image1529Not measuredOnly Claude Sonnet 4.6 measured
Neither model has a result on the other 17 boards here
IntelligenceLike-for-likePublic boards, shown as published, kept out of the index20
Intelligence benchmarks for Claude Sonnet 4.6 and Gemma 4 31B
BenchmarkClaude Sonnet 4.6Gemma 4 31BLeader
AA Intelligence Index30.114.7Claude Sonnet 4.6
Epoch Capabilities Index152.8143.0Claude Sonnet 4.6
Agentic workLike-for-likePublic boards, shown as published, kept out of the index50
Agentic work benchmarks for Claude Sonnet 4.6 and Gemma 4 31B
BenchmarkClaude Sonnet 4.6Gemma 4 31BLeader
AA Agentic Index31.84.2Claude Sonnet 4.6
Design Arena: agents building web apps1190Not measuredOnly Claude Sonnet 4.6 measured
Design Arena: agents building full-stack apps1213Not measuredOnly Claude Sonnet 4.6 measured
Design Arena: agents building mobile apps1212Not measuredOnly Claude Sonnet 4.6 measured
Design Arena: agents building Android apps1202Not measuredOnly Claude Sonnet 4.6 measured
Design Arena: agents building Godot games1226Not measuredOnly Claude Sonnet 4.6 measured
Design Arena: agents building games1177Not measuredOnly Claude Sonnet 4.6 measured
LiveBench research63.6%44.4%Claude Sonnet 4.6
LiveBench browser68.0%4.0%Claude Sonnet 4.6
LiveBench long agentic23.1%13.3%Claude Sonnet 4.6
Finance Agent (Vals AI)51.0%Not measuredOnly Claude Sonnet 4.6 measured
Tax Agent Bench (Vals AI)25.8%Not measuredOnly Claude Sonnet 4.6 measured
Legal Research Bench (Vals AI)38.5%Not measuredOnly Claude Sonnet 4.6 measured
Excel Modeling Benchmark (Vals AI)60.2%Not measuredOnly Claude Sonnet 4.6 measured
τ²-Bench Telecom79.5%65.5%Claude Sonnet 4.6
APEX-Agents43.0%Not measuredOnly Claude Sonnet 4.6 measured
OSWorld 2.09.3%Not measuredOnly Claude Sonnet 4.6 measured
DeepResearch Bench54.9%Not measuredOnly Claude Sonnet 4.6 measured
OSWorld72.1%Not measuredOnly Claude Sonnet 4.6 measured
Vending-Bench 2$7,204Not measuredOnly Claude Sonnet 4.6 measured
Neither model has a result on the other 19 boards here
ReasoningLike-for-likePublic boards, shown as published, kept out of the index90
Reasoning benchmarks for Claude Sonnet 4.6 and Gemma 4 31B
BenchmarkClaude Sonnet 4.6Gemma 4 31BLeader
GPQA Diamond85.6%Not measuredOnly Claude Sonnet 4.6 measured
LiveBench reasoning86.4%68.3%Claude Sonnet 4.6
MMMU Pro (Vals AI)83.6%Not measuredOnly Claude Sonnet 4.6 measured
GPQA Diamond (Artificial Analysis run)87.5%85.7%Claude Sonnet 4.6
Humanity's Last Exam (Artificial Analysis run)33.6%23.6%Claude Sonnet 4.6
GPQA Diamond (Epoch AI run)87.4%75.8%Claude Sonnet 4.6
ARC-AGI86.5%Not measuredOnly Claude Sonnet 4.6 measured
ARC-AGI-260.4%Not measuredOnly Claude Sonnet 4.6 measured
Chess puzzles23.0%Not measuredOnly Claude Sonnet 4.6 measured
Mystery game puzzles16.0%Not measuredOnly Claude Sonnet 4.6 measured
LMArena Text: hard prompts14851448Claude Sonnet 4.6
LMArena Text: expert15001464Claude Sonnet 4.6
LMArena Text: hard prompts in English14931456Claude Sonnet 4.6
LMArena Vision: diagrams13061283Claude Sonnet 4.6
LMArena Vision: homework13111310Claude Sonnet 4.6
Neither model has a result on the other 6 boards here
MathLike-for-likePublic boards, shown as published, kept out of the index21
Math benchmarks for Claude Sonnet 4.6 and Gemma 4 31B
BenchmarkClaude Sonnet 4.6Gemma 4 31BLeader
AIME92.3%Not measuredOnly Claude Sonnet 4.6 measured
OTIS Mock AIME85.8%73.3%Claude Sonnet 4.6
ProofBench45.0%Not measuredOnly Claude Sonnet 4.6 measured
LMArena Text: math14621463Gemma 4 31B
LMArena Text: mathematical work14831465Claude Sonnet 4.6
Neither model has a result on the other 8 boards here
KnowledgeLike-for-likePublic boards, shown as published, kept out of the index70
Knowledge benchmarks for Claude Sonnet 4.6 and Gemma 4 31B
BenchmarkClaude Sonnet 4.6Gemma 4 31BLeader
MMLU Pro87.3%Not measuredOnly Claude Sonnet 4.6 measured
LegalBench (Vals AI)82.1%Not measuredOnly Claude Sonnet 4.6 measured
CaseLaw (Vals AI)64.0%52.6%Claude Sonnet 4.6
CorpFin (Vals AI)65.3%Not measuredOnly Claude Sonnet 4.6 measured
TaxEval (Vals AI)77.1%Not measuredOnly Claude Sonnet 4.6 measured
MortgageTax (Vals AI)67.7%61.4%Claude Sonnet 4.6
MedQA (Vals AI)92.1%Not measuredOnly Claude Sonnet 4.6 measured
SimpleQA Verified35.5%10.4%Claude Sonnet 4.6
LMArena Text: science14741457Claude Sonnet 4.6
LMArena Text: medicine and healthcare14511451Claude Sonnet 4.6
LMArena Text: legal and government14701438Claude Sonnet 4.6
LMArena Text: business and finance14641430Claude Sonnet 4.6
Neither model has a result on the other 5 boards here
Web designLike-for-likePublic boards, shown as published, kept out of the index10
Web design benchmarks for Claude Sonnet 4.6 and Gemma 4 31B
BenchmarkClaude Sonnet 4.6Gemma 4 31BLeader
Design Arena: websites1285Not measuredOnly Claude Sonnet 4.6 measured
Design Arena: UI components1271Not measuredOnly Claude Sonnet 4.6 measured
Design Arena: game dev1259Not measuredOnly Claude Sonnet 4.6 measured
Design Arena: data viz1278Not measuredOnly Claude Sonnet 4.6 measured
Design Arena: 3D1234Not measuredOnly Claude Sonnet 4.6 measured
Design Arena: all code categories1276Not measuredOnly Claude Sonnet 4.6 measured
Design Arena: SVG1196Not measuredOnly Claude Sonnet 4.6 measured
Design Arena: ASCII art1235Not measuredOnly Claude Sonnet 4.6 measured
LiveBench design71.8%58.4%Claude Sonnet 4.6
GeneralLike-for-likePublic boards, shown as published, kept out of the index217
General benchmarks for Claude Sonnet 4.6 and Gemma 4 31B
BenchmarkClaude Sonnet 4.6Gemma 4 31BLeader
LiveBench data analysis76.1%53.3%Claude Sonnet 4.6
Public Benefits Bench (Vals AI)62.5%Not measuredOnly Claude Sonnet 4.6 measured
SAGE (Vals AI)46.6%55.0%Gemma 4 31B
Vals Multimodal Index60.6%Not measuredOnly Claude Sonnet 4.6 measured
IFBench56.6%75.6%Gemma 4 31B
Long context reasoning (AA-LCR)80.0%69.7%Claude Sonnet 4.6
DTBench89.9%82.7%Claude Sonnet 4.6
LMCA46.5%39.3%Claude Sonnet 4.6
Surface Evolver BenchNot measured30.6%Only Gemma 4 31B measured
ExploitBench23.6%Not measuredOnly Claude Sonnet 4.6 measured
LMArena Text14581443Claude Sonnet 4.6
LMArena Text: instruction following14761433Claude Sonnet 4.6
LMArena Text: creative writing14351417Claude Sonnet 4.6
LMArena Vision12831276Claude Sonnet 4.6
LMArena Text: English14721451Claude Sonnet 4.6
LMArena Text: non-English14401430Claude Sonnet 4.6
LMArena Text: Chinese14911475Claude Sonnet 4.6
LMArena Text: German1428Not measuredOnly Claude Sonnet 4.6 measured
LMArena Text: Japanese1420Not measuredOnly Claude Sonnet 4.6 measured
LMArena Text: Korean1410Not measuredOnly Claude Sonnet 4.6 measured
LMArena Text: French14651436Claude Sonnet 4.6
LMArena Text: Spanish14641442Claude Sonnet 4.6
LMArena Text: Russian14401460Gemma 4 31B
LMArena Text: Polish14431433Claude Sonnet 4.6
LMArena Text: multi-turn14641452Claude Sonnet 4.6
LMArena Text: longer queries14791446Claude Sonnet 4.6
LMArena Text: writing and language14441432Claude Sonnet 4.6
LMArena Text: entertainment and media14311405Claude Sonnet 4.6
LMArena Vision: English12981271Claude Sonnet 4.6
LMArena Vision: Chinese13071326Gemma 4 31B
LMArena Vision: reading text12961282Claude Sonnet 4.6
LMArena Vision: humor12481280Gemma 4 31B
LMArena Vision: captioningNot measured1218Only Gemma 4 31B measured
LMArena Vision: recognizing things11951226Gemma 4 31B
LMArena Vision: creative writing12721285Gemma 4 31B
LMArena Document14821425Claude Sonnet 4.6
Neither model has a result on the other 10 boards here
Image generationNot comparablePublic boards, shown as published, kept out of the index0 boards, none shared
Image generation benchmarks for Claude Sonnet 4.6 and Gemma 4 31B
BenchmarkClaude Sonnet 4.6Gemma 4 31BLeader
Neither model has a result on 5 boards here

What each workload costs

Three fixed token mixes at each model's listed price, so per-token rates become a bill.

Chat turn

1K input + 500 output tokens

Claude Sonnet 4.6$0.011Fits in one request
Gemma 4 31B$0.0004Fits in one request

Gemma 4 31B costs less

Repository review

50K input + 3K output tokens

Claude Sonnet 4.6$0.195Fits in one request
Gemma 4 31B$0.011Fits in one request

Gemma 4 31B costs less

Agent loop

200K input + 10K output tokens

Claude Sonnet 4.6$0.750Fits in one request
Gemma 4 31B$0.044Fits in one request

Gemma 4 31B costs less

Listed OpenRouter rates, without cache or batch discounts. A workload that does not fit a model's context window would need splitting.

Specification differences

The leading value in a row is marked; a row with a missing value names no leader. Our two rows are marked in red.

Specifications of Claude Sonnet 4.6 and Gemma 4 31B
SpecificationAnthropic Claude Sonnet 4.6Google Gemma 4 31B
MakerAnthropicGoogle
WeightsNo public weights listedOpen weights
ReleasedFebruary 17, 2026April 2, 2026
Context window1M262K
Input $/Mtok$3.00$0.20
Output $/Mtok$15.00$0.40
Coding index57.838.3
Independent measurements behind it22
Cost per solved task$1.68Not computable
SourceOpenRouter listingOpenRouter listing

Questions

Is Claude Sonnet 4.6 better than Gemma 4 31B for coding?

Pick Claude Sonnet 4.6 for coding: it scores 57.8 on the Vibe Coding Index against 38.3 for Gemma 4 31B. Pick Gemma 4 31B when output tokens cost 37.5x less, or when what matters is LMArena Text: math or SAGE (Vals AI), where it leads.

Which is cheaper, Claude Sonnet 4.6 or Gemma 4 31B?

Claude Sonnet 4.6 costs $3.00 per million input tokens and $15.00 per million output tokens; Gemma 4 31B costs $0.20 and $0.40. Cost per solved task is known for Claude Sonnet 4.6 only.

Which has the bigger context window, Claude Sonnet 4.6 or Gemma 4 31B?

Claude Sonnet 4.6, with 1M tokens against 262K.

How many benchmarks is the Claude Sonnet 4.6 vs Gemma 4 31B comparison based on?

65 benchmarks have a result for both models as of October 21, 2026. Claude Sonnet 4.6's coding index rests on 2 independent benchmarks and Gemma 4 31B's on 2. Where only one model has a result, the page says so instead of naming a winner.

Compare next

Embed this comparison on your site

Free under CC BY 4.0, while the source link stays visible. Preview the frame · Terms and other embeds

<iframe src="https://llmbenchmark.ai/embed/compare/claude-sonnet-4-6-vs-gemma-4-31b-it" title="Claude Sonnet 4.6 vs Gemma 4 31B, LLMBenchmark.ai" width="100%" height="360" style="border:0;max-width:100%" loading="lazy"></iframe>
<p style="font:13px/1.4 sans-serif;margin:6px 0 0">Source: <a href="https://llmbenchmark.ai/compare/claude-sonnet-4-6-vs-gemma-4-31b-it">LLMBenchmark.ai, Claude Sonnet 4.6 vs Gemma 4 31B</a></p>