Enter opens the highlighted result. Esc closes.

Claude Opus 4.7 vs Gemma 4 31B

Claude Opus 4.7 leads Gemma 4 31B on coding, 67.5 to 39.0 on the Vibe Coding Index, and Gemma 4 31B costs 62.5x less per output token ($0.40 vs $25.00 per million). Updated October 22, 2026; 59 benchmarks have a result for both.

Claude Opus 4.7Anthropic
Coding
67.5
Overall
71.6
Output $/M
$25.00
58
Gemma 4 31BGoogle
Coding
39.0
Overall
42.1
Output $/M
$0.40
1
vs boards won of 59 shared

Claude Opus 4.7 or Gemma 4 31B: which to pick

Pick Claude Opus 4.7 for coding: it scores 67.5 on the Vibe Coding Index against 39.0 for Gemma 4 31B.

Pick Gemma 4 31B for output tokens 62.5x cheaper ($0.40 vs $25.00 per million) and work measured by IFBench, where it leads.

Shared results
59
Claude Opus 4.7 only
44
Gemma 4 31B only
12
Like-for-like categories
7 of 9

Only benchmarks that tested both models count toward a pick; a result only one model has is shown but not compared.

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 Opus 4.7 67.5 from 4 benchmarks, Gemma 4 31B 39.0 from 2 benchmarks.
Widest category
Agentic work, 28.7 points apart on average over 2 shared benchmarks.
Widest single gap
SimpleQA Verified: Claude Opus 4.7 51.7% against Gemma 4 31B 10.4%, 41.3 points apart on a 0 to 100 scale.
Output price
Claude Opus 4.7 $25.00 against Gemma 4 31B $0.40 per million output tokens, 62.5x apart.
Context window
Claude Opus 4.7 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 Opus 4.7BarsGemma 4 31BTies
Coding80
Intelligence20
Agentic work20
Reasoning90
Math30
Knowledge80
General261
All shared boards581
CodingLike-for-likeSix of these boards feed the Vibe Coding Index80
Coding benchmarks for Claude Opus 4.7 and Gemma 4 31B
BenchmarkClaude Opus 4.7Gemma 4 31BLeader
LiveBench codingNot measured49.0%Only Gemma 4 31B measured
LMArena WebDev15581367Claude Opus 4.7
AA Coding Index73.643.4Claude Opus 4.7
LiveCodeBench (Vals AI)85.1%Not measuredOnly Claude Opus 4.7 measured
SWE-bench Verified (Vals AI)82.0%Not measuredOnly Claude Opus 4.7 measured
Vibe Code Bench (Vals AI)71.0%Not measuredOnly Claude Opus 4.7 measured
Code migration (Vals AI)43.9%Not measuredOnly Claude Opus 4.7 measured
ProgramBench (Vals AI)0.0%Not measuredOnly Claude Opus 4.7 measured
Terminal-Bench 2.1 (Vals AI)68.5%Not measuredOnly Claude Opus 4.7 measured
SciCodeNot measured45.5%Only Gemma 4 31B measured
Terminal-Bench Hard (Artificial Analysis run)54.5%36.4%Claude Opus 4.7
Terminal-Bench80.2%Not measuredOnly Claude Opus 4.7 measured
FrontierCode38.5%Not measuredOnly Claude Opus 4.7 measured
GSO-Bench44.1%Not measuredOnly Claude Opus 4.7 measured
WeirdML76.4%52.3%Claude Opus 4.7
MirrorCode31.1%Not measuredOnly Claude Opus 4.7 measured
ALE-BenchNot measured925.5Only Gemma 4 31B measured
LMArena Text: coding15191459Claude Opus 4.7
LMArena Text: software and IT15161463Claude Opus 4.7
LMArena WebDev: React15601359Claude Opus 4.7
LMArena WebDev: HTML15541380Claude Opus 4.7
LMArena WebDev: from an image1577Not measuredOnly Claude Opus 4.7 measured
SciCodeNot measured8.9%Only Gemma 4 31B measured
Neither model has a result on the other 16 boards here
IntelligenceLike-for-likePublic boards, shown as published, kept out of the index20
Intelligence benchmarks for Claude Opus 4.7 and Gemma 4 31B
BenchmarkClaude Opus 4.7Gemma 4 31BLeader
AA Intelligence Index40.714.7Claude Opus 4.7
Epoch Capabilities Index156.8143.0Claude Opus 4.7
Agentic workLike-for-likePublic boards, shown as published, kept out of the index20
Agentic work benchmarks for Claude Opus 4.7 and Gemma 4 31B
BenchmarkClaude Opus 4.7Gemma 4 31BLeader
AA Agentic Index38.64.2Claude Opus 4.7
LiveBench researchNot measured44.4%Only Gemma 4 31B measured
LiveBench browserNot measured4.0%Only Gemma 4 31B measured
LiveBench long agenticNot measured13.3%Only Gemma 4 31B measured
Finance Agent (Vals AI)51.5%Not measuredOnly Claude Opus 4.7 measured
Tax Agent Bench (Vals AI)23.7%Not measuredOnly Claude Opus 4.7 measured
Legal Research Bench (Vals AI)38.5%Not measuredOnly Claude Opus 4.7 measured
Excel Modeling Benchmark (Vals AI)63.7%Not measuredOnly Claude Opus 4.7 measured
τ²-Bench Telecom88.6%65.5%Claude Opus 4.7
APEX-Agents49.2%Not measuredOnly Claude Opus 4.7 measured
OSWorld 2.018.2%Not measuredOnly Claude Opus 4.7 measured
PostTrainBench28.6%Not measuredOnly Claude Opus 4.7 measured
Vending-Bench 2$10,937Not measuredOnly Claude Opus 4.7 measured
LMArena Search1230Not measuredOnly Claude Opus 4.7 measured
Neither model has a result on the other 27 boards here
ReasoningLike-for-likePublic boards, shown as published, kept out of the index90
Reasoning benchmarks for Claude Opus 4.7 and Gemma 4 31B
BenchmarkClaude Opus 4.7Gemma 4 31BLeader
GPQA Diamond90.2%Not measuredOnly Claude Opus 4.7 measured
LiveBench reasoningNot measured68.3%Only Gemma 4 31B measured
MMMU Pro (Vals AI)85.5%Not measuredOnly Claude Opus 4.7 measured
GPQA Diamond (Artificial Analysis run)91.4%85.7%Claude Opus 4.7
Humanity's Last Exam (Artificial Analysis run)42.3%23.6%Claude Opus 4.7
GPQA Diamond (Epoch AI run)90.2%75.8%Claude Opus 4.7
ARC-AGI93.5%Not measuredOnly Claude Opus 4.7 measured
ARC-AGI-275.8%Not measuredOnly Claude Opus 4.7 measured
SimpleBench61.7%Not measuredOnly Claude Opus 4.7 measured
Chess puzzles41.0%Not measuredOnly Claude Opus 4.7 measured
Mystery game puzzles28.0%Not measuredOnly Claude Opus 4.7 measured
EBR-bench19.0%Not measuredOnly Claude Opus 4.7 measured
LMArena Text: hard prompts15061448Claude Opus 4.7
LMArena Text: expert15211464Claude Opus 4.7
LMArena Text: hard prompts in English15081456Claude Opus 4.7
LMArena Vision: diagrams13361283Claude Opus 4.7
LMArena Vision: homework13371310Claude Opus 4.7
Kagi LLM Benchmark80.7%63.5%Claude Opus 4.7
Neither model has a result on the other 4 boards here
MathLike-for-likePublic boards, shown as published, kept out of the index30
Math benchmarks for Claude Opus 4.7 and Gemma 4 31B
BenchmarkClaude Opus 4.7Gemma 4 31BLeader
AIME96.3%Not measuredOnly Claude Opus 4.7 measured
OTIS Mock AIME97.8%73.3%Claude Opus 4.7
FrontierMath, tiers 1 to 370.2%Not measuredOnly Claude Opus 4.7 measured
FrontierMath, tier 431.7%Not measuredOnly Claude Opus 4.7 measured
ProofBench54.0%Not measuredOnly Claude Opus 4.7 measured
LMArena Text: math14981463Claude Opus 4.7
LMArena Text: mathematical work15091465Claude Opus 4.7
Neither model has a result on the other 6 boards here
KnowledgeLike-for-likePublic boards, shown as published, kept out of the index80
Knowledge benchmarks for Claude Opus 4.7 and Gemma 4 31B
BenchmarkClaude Opus 4.7Gemma 4 31BLeader
MMLU Pro89.9%Not measuredOnly Claude Opus 4.7 measured
LegalBench (Vals AI)85.3%Not measuredOnly Claude Opus 4.7 measured
CaseLaw (Vals AI)68.4%52.6%Claude Opus 4.7
CorpFin (Vals AI)66.1%Not measuredOnly Claude Opus 4.7 measured
TaxEval (Vals AI)75.3%Not measuredOnly Claude Opus 4.7 measured
MortgageTax (Vals AI)70.3%61.4%Claude Opus 4.7
MedCode (Vals AI)54.9%Not measuredOnly Claude Opus 4.7 measured
SimpleQA Verified51.7%10.4%Claude Opus 4.7
LMArena Text: science15081457Claude Opus 4.7
LMArena Text: medicine and healthcare14951451Claude Opus 4.7
LMArena Text: legal and government15041438Claude Opus 4.7
LMArena Text: business and finance14901430Claude Opus 4.7
FACTS Benchmark Suite45.5%45.3%Claude Opus 4.7
Neither model has a result on the other 5 boards here
Web designDirectional onlyPublic boards, shown as published, kept out of the index1 board, none shared
Web design benchmarks for Claude Opus 4.7 and Gemma 4 31B
BenchmarkClaude Opus 4.7Gemma 4 31BLeader
LiveBench designNot measured58.4%Only Gemma 4 31B measured
Neither model has a result on the other 8 boards here
GeneralLike-for-likePublic boards, shown as published, kept out of the index261
General benchmarks for Claude Opus 4.7 and Gemma 4 31B
BenchmarkClaude Opus 4.7Gemma 4 31BLeader
LiveBench data analysisNot measured53.3%Only Gemma 4 31B measured
SAGE (Vals AI)56.1%55.0%Claude Opus 4.7
MedScribe (Vals AI)83.0%Not measuredOnly Claude Opus 4.7 measured
Vals Multimodal Index67.4%Not measuredOnly Claude Opus 4.7 measured
IFBench58.6%75.6%Gemma 4 31B
Long context reasoning (AA-LCR)78.7%69.7%Claude Opus 4.7
DTBench94.7%82.7%Claude Opus 4.7
LMCA52.2%39.3%Claude Opus 4.7
Surface Evolver BenchNot measured30.6%Only Gemma 4 31B measured
Furniture assembly33.3%Not measuredOnly Claude Opus 4.7 measured
ExploitBench26.5%Not measuredOnly Claude Opus 4.7 measured
LMArena Text14901443Claude Opus 4.7
LMArena Text: instruction following14981433Claude Opus 4.7
LMArena Text: creative writing14861417Claude Opus 4.7
LMArena Vision13171276Claude Opus 4.7
LMArena Text: English14961451Claude Opus 4.7
LMArena Text: non-English14801430Claude Opus 4.7
LMArena Text: Chinese15311475Claude Opus 4.7
LMArena Text: German1495Not measuredOnly Claude Opus 4.7 measured
LMArena Text: Japanese1474Not measuredOnly Claude Opus 4.7 measured
LMArena Text: Korean1464Not measuredOnly Claude Opus 4.7 measured
LMArena Text: French15031436Claude Opus 4.7
LMArena Text: Spanish14941442Claude Opus 4.7
LMArena Text: Russian14941460Claude Opus 4.7
LMArena Text: Polish14891433Claude Opus 4.7
LMArena Text: multi-turn15051452Claude Opus 4.7
LMArena Text: longer queries15051446Claude Opus 4.7
LMArena Text: writing and language14921432Claude Opus 4.7
LMArena Text: entertainment and media14741405Claude Opus 4.7
LMArena Vision: English13221271Claude Opus 4.7
LMArena Vision: Chinese13711326Claude Opus 4.7
LMArena Vision: reading text13271282Claude Opus 4.7
LMArena Vision: humor13091280Claude Opus 4.7
LMArena Vision: captioningNot measured1218Only Gemma 4 31B measured
LMArena Vision: recognizing things12781226Claude Opus 4.7
LMArena Vision: creative writing13261285Claude Opus 4.7
LMArena Document14951425Claude Opus 4.7
Neither model has a result on the other 9 boards here
Image generationNot comparablePublic boards, shown as published, kept out of the index0 boards, none shared
Image generation benchmarks for Claude Opus 4.7 and Gemma 4 31B
BenchmarkClaude Opus 4.7Gemma 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 Opus 4.7$0.018Fits in one request
Gemma 4 31B$0.0003Fits in one request

Gemma 4 31B costs less

Repository review

50K input + 3K output tokens

Claude Opus 4.7$0.325Fits in one request
Gemma 4 31B$0.0082Fits in one request

Gemma 4 31B costs less

Agent loop

200K input + 10K output tokens

Claude Opus 4.7$1.25Fits in one request
Gemma 4 31B$0.032Fits 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 Opus 4.7 and Gemma 4 31B
SpecificationAnthropic Claude Opus 4.7Google Gemma 4 31B
MakerAnthropicGoogle
WeightsNo public weights listedOpen weights
ReleasedApril 16, 2026April 2, 2026
Context window1M262K
Input $/Mtok$5.00$0.14
Output $/Mtok$25.00$0.40
Coding index67.539.0
Independent measurements behind it42
Cost per solved task$2.95Not computable
SourceOpenRouter listingOpenRouter listing

Questions

Is Claude Opus 4.7 better than Gemma 4 31B for coding?

Pick Claude Opus 4.7 for coding: it scores 67.5 on the Vibe Coding Index against 39.0 for Gemma 4 31B. Pick Gemma 4 31B for output tokens 62.5x cheaper ($0.40 vs $25.00 per million) and work measured by IFBench, where it leads.

Which is cheaper, Claude Opus 4.7 or Gemma 4 31B?

Claude Opus 4.7 costs $5.00 per million input tokens and $25.00 per million output tokens; Gemma 4 31B costs $0.14 and $0.40. Cost per solved task is known for Claude Opus 4.7 only.

Which has the bigger context window, Claude Opus 4.7 or Gemma 4 31B?

Claude Opus 4.7, with 1M tokens against 262K.

How many benchmarks is the Claude Opus 4.7 vs Gemma 4 31B comparison based on?

59 benchmarks have a result for both models as of October 22, 2026. Claude Opus 4.7's coding index rests on 4 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-opus-4-7-vs-gemma-4-31b-it" title="Claude Opus 4.7 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-opus-4-7-vs-gemma-4-31b-it">LLMBenchmark.ai, Claude Opus 4.7 vs Gemma 4 31B</a></p>