Enter opens the highlighted result. Esc closes.

Claude Haiku 4.5 vs Gemma 4 31B

Gemma 4 31B leads Claude Haiku 4.5 on coding, 39.0 to 35.6 on the Vibe Coding Index, and Gemma 4 31B costs 12.5x less per output token ($0.40 vs $5.00 per million). Updated October 22, 2026; 49 benchmarks have a result for both.

Claude Haiku 4.5Anthropic
Coding
35.6
Overall
41.0
Output $/M
$5.00
9
Gemma 4 31BGoogle
Coding
39.0
Overall
42.1
Output $/M
$0.40
40
vs boards won of 49 shared

Claude Haiku 4.5 or Gemma 4 31B: which to pick

Pick Gemma 4 31B for coding: it scores 39.0 on the Vibe Coding Index against 35.6 for Claude Haiku 4.5, though on 2 benchmarks against 4.

Pick Claude Haiku 4.5 for work measured by AA Coding Index or AA Intelligence Index, where it leads.

Shared results
49
Claude Haiku 4.5 only
46
Gemma 4 31B only
22
Like-for-like categories
8 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 Haiku 4.5 35.6 from 4 benchmarks, Gemma 4 31B 39.0 from 2 benchmarks.
Widest category
Agentic work, 11.0 points apart on average over 4 shared benchmarks.
Widest single gap
LiveBench browser: Claude Haiku 4.5 40.0% against Gemma 4 31B 4.0%, 36.0 points apart on a 0 to 100 scale.
Output price
Claude Haiku 4.5 $5.00 against Gemma 4 31B $0.40 per million output tokens, 12.5x apart.
Context window
Claude Haiku 4.5 takes 200K 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 Haiku 4.5BarsGemma 4 31BTies
Coding17
Intelligence11
Agentic work22
Reasoning05
Math03
Knowledge34
Web design10
General118
All shared boards940
CodingLike-for-likeSix of these boards feed the Vibe Coding Index17
Coding benchmarks for Claude Haiku 4.5 and Gemma 4 31B
BenchmarkClaude Haiku 4.5Gemma 4 31BLeader
SWE-bench Verified66.6%Not measuredOnly Claude Haiku 4.5 measured
SWE-bench Multilingual64.7%Not measuredOnly Claude Haiku 4.5 measured
LiveBench coding48.1%49.0%Gemma 4 31B
LMArena WebDev13301367Gemma 4 31B
AA Coding Index43.943.4Claude Haiku 4.5
LiveCodeBench (Vals AI)41.2%Not measuredOnly Claude Haiku 4.5 measured
SWE-bench Verified (Vals AI)66.6%Not measuredOnly Claude Haiku 4.5 measured
Vibe Code Bench (Vals AI)11.4%Not measuredOnly Claude Haiku 4.5 measured
Code migration (Vals AI)7.5%Not measuredOnly Claude Haiku 4.5 measured
ProgramBench (Vals AI)0.0%Not measuredOnly Claude Haiku 4.5 measured
Terminal-Bench 2.1 (Vals AI)43.8%Not measuredOnly Claude Haiku 4.5 measured
SciCodeNot measured45.5%Only Gemma 4 31B measured
Terminal-Bench Hard (Artificial Analysis run)Not measured36.4%Only Gemma 4 31B measured
Terminal-Bench35.5%Not measuredOnly Claude Haiku 4.5 measured
WeirdML45.4%52.3%Gemma 4 31B
ALE-BenchNot measured925.5Only Gemma 4 31B measured
LMArena Text: coding14541459Gemma 4 31B
LMArena Text: software and IT14391463Gemma 4 31B
LMArena WebDev: React13261359Gemma 4 31B
LMArena WebDev: HTML13181380Gemma 4 31B
SciCodeNot measured8.9%Only Gemma 4 31B measured
Neither model has a result on the other 18 boards here
IntelligenceLike-for-likePublic boards, shown as published, kept out of the index11
Intelligence benchmarks for Claude Haiku 4.5 and Gemma 4 31B
BenchmarkClaude Haiku 4.5Gemma 4 31BLeader
AA Intelligence Index16.914.7Claude Haiku 4.5
Epoch Capabilities Index142.2143.0Gemma 4 31B
Agentic workLike-for-likePublic boards, shown as published, kept out of the index22
Agentic work benchmarks for Claude Haiku 4.5 and Gemma 4 31B
BenchmarkClaude Haiku 4.5Gemma 4 31BLeader
AA Agentic Index8.04.2Claude Haiku 4.5
LiveBench research42.2%44.4%Gemma 4 31B
LiveBench browser40.0%4.0%Claude Haiku 4.5
LiveBench long agentic11.1%13.3%Gemma 4 31B
Finance Agent (Vals AI)31.0%Not measuredOnly Claude Haiku 4.5 measured
Tax Agent Bench (Vals AI)5.9%Not measuredOnly Claude Haiku 4.5 measured
Legal Research Bench (Vals AI)10.6%Not measuredOnly Claude Haiku 4.5 measured
Excel Modeling Benchmark (Vals AI)22.7%Not measuredOnly Claude Haiku 4.5 measured
τ²-Bench TelecomNot measured65.5%Only Gemma 4 31B measured
BALROG31.2%Not measuredOnly Claude Haiku 4.5 measured
DeepResearch Bench45.5%Not measuredOnly Claude Haiku 4.5 measured
Vending-Bench 2$459Not measuredOnly Claude Haiku 4.5 measured
Berkeley Function Calling Leaderboard (BFCL)68.7%Not measuredOnly Claude Haiku 4.5 measured
Neither model has a result on the other 28 boards here
ReasoningLike-for-likePublic boards, shown as published, kept out of the index05
Reasoning benchmarks for Claude Haiku 4.5 and Gemma 4 31B
BenchmarkClaude Haiku 4.5Gemma 4 31BLeader
GPQA Diamond72.2%Not measuredOnly Claude Haiku 4.5 measured
LiveBench reasoning61.7%68.3%Gemma 4 31B
MMMU Pro (Vals AI)46.1%Not measuredOnly Claude Haiku 4.5 measured
GPQA Diamond (Artificial Analysis run)Not measured85.7%Only Gemma 4 31B measured
Humanity's Last Exam (Artificial Analysis run)Not measured23.6%Only Gemma 4 31B measured
GPQA Diamond (Epoch AI run)71.2%75.8%Gemma 4 31B
ARC-AGI47.7%Not measuredOnly Claude Haiku 4.5 measured
ARC-AGI-24.0%Not measuredOnly Claude Haiku 4.5 measured
Chess puzzles8.0%Not measuredOnly Claude Haiku 4.5 measured
LMArena Text: hard prompts14211448Gemma 4 31B
LMArena Text: expert14431464Gemma 4 31B
LMArena Text: hard prompts in English14351456Gemma 4 31B
LMArena Vision: diagramsNot measured1283Only Gemma 4 31B measured
LMArena Vision: homeworkNot measured1310Only Gemma 4 31B measured
Kagi LLM BenchmarkNot measured63.5%Only Gemma 4 31B measured
Neither model has a result on the other 7 boards here
MathLike-for-likePublic boards, shown as published, kept out of the index03
Math benchmarks for Claude Haiku 4.5 and Gemma 4 31B
BenchmarkClaude Haiku 4.5Gemma 4 31BLeader
AIME82.7%Not measuredOnly Claude Haiku 4.5 measured
MGSM (Vals AI)92.2%Not measuredOnly Claude Haiku 4.5 measured
OTIS Mock AIME66.7%73.3%Gemma 4 31B
MATH level 596.4%Not measuredOnly Claude Haiku 4.5 measured
LMArena Text: math13981463Gemma 4 31B
LMArena Text: mathematical work14301465Gemma 4 31B
Neither model has a result on the other 7 boards here
KnowledgeLike-for-likePublic boards, shown as published, kept out of the index34
Knowledge benchmarks for Claude Haiku 4.5 and Gemma 4 31B
BenchmarkClaude Haiku 4.5Gemma 4 31BLeader
MMLU Pro78.7%Not measuredOnly Claude Haiku 4.5 measured
LegalBench (Vals AI)81.2%Not measuredOnly Claude Haiku 4.5 measured
CaseLaw (Vals AI)56.5%52.6%Claude Haiku 4.5
CorpFin (Vals AI)60.6%Not measuredOnly Claude Haiku 4.5 measured
TaxEval (Vals AI)67.5%Not measuredOnly Claude Haiku 4.5 measured
MortgageTax (Vals AI)62.2%61.4%Claude Haiku 4.5
MedQA (Vals AI)79.6%Not measuredOnly Claude Haiku 4.5 measured
MedCode (Vals AI)32.7%Not measuredOnly Claude Haiku 4.5 measured
SimpleQA Verified13.2%10.4%Claude Haiku 4.5
LMArena Text: science14061457Gemma 4 31B
LMArena Text: medicine and healthcare13941451Gemma 4 31B
LMArena Text: legal and government14001438Gemma 4 31B
LMArena Text: business and finance14001430Gemma 4 31B
FACTS Benchmark SuiteNot measured45.3%Only Gemma 4 31B measured
Neither model has a result on the other 4 boards here
Web designLike-for-likePublic boards, shown as published, kept out of the index10
Web design benchmarks for Claude Haiku 4.5 and Gemma 4 31B
BenchmarkClaude Haiku 4.5Gemma 4 31BLeader
Design Arena: websites1122Not measuredOnly Claude Haiku 4.5 measured
Design Arena: UI components1097Not measuredOnly Claude Haiku 4.5 measured
Design Arena: game dev1097Not measuredOnly Claude Haiku 4.5 measured
Design Arena: data viz1124Not measuredOnly Claude Haiku 4.5 measured
Design Arena: 3D1071Not measuredOnly Claude Haiku 4.5 measured
Design Arena: all code categories1114Not measuredOnly Claude Haiku 4.5 measured
Design Arena: SVG1025Not measuredOnly Claude Haiku 4.5 measured
Design Arena: ASCII art1140Not measuredOnly Claude Haiku 4.5 measured
LiveBench design59.9%58.4%Claude Haiku 4.5
GeneralLike-for-likePublic boards, shown as published, kept out of the index118
General benchmarks for Claude Haiku 4.5 and Gemma 4 31B
BenchmarkClaude Haiku 4.5Gemma 4 31BLeader
LiveBench data analysis59.3%53.3%Claude Haiku 4.5
Public Benefits Bench (Vals AI)54.3%Not measuredOnly Claude Haiku 4.5 measured
SAGE (Vals AI)31.8%55.0%Gemma 4 31B
MedScribe (Vals AI)85.2%Not measuredOnly Claude Haiku 4.5 measured
Vals Multimodal Index42.9%Not measuredOnly Claude Haiku 4.5 measured
IFBenchNot measured75.6%Only Gemma 4 31B measured
Long context reasoning (AA-LCR)Not measured69.7%Only Gemma 4 31B measured
DTBench73.6%82.7%Gemma 4 31B
LMCA30.9%39.3%Gemma 4 31B
Surface Evolver BenchNot measured30.6%Only Gemma 4 31B measured
ExploitBench13.7%Not measuredOnly Claude Haiku 4.5 measured
LMArena Text13971443Gemma 4 31B
LMArena Text: instruction following14141433Gemma 4 31B
LMArena Text: creative writing13711417Gemma 4 31B
LMArena VisionNot measured1276Only Gemma 4 31B measured
LMArena Text: English14141451Gemma 4 31B
LMArena Text: non-English13771430Gemma 4 31B
LMArena Text: Chinese14181475Gemma 4 31B
LMArena Text: German1374Not measuredOnly Claude Haiku 4.5 measured
LMArena Text: Japanese1338Not measuredOnly Claude Haiku 4.5 measured
LMArena Text: Korean1346Not measuredOnly Claude Haiku 4.5 measured
LMArena Text: French14111436Gemma 4 31B
LMArena Text: Spanish14211442Gemma 4 31B
LMArena Text: Russian13811460Gemma 4 31B
LMArena Text: Polish13431433Gemma 4 31B
LMArena Text: multi-turn14091452Gemma 4 31B
LMArena Text: longer queries14271446Gemma 4 31B
LMArena Text: writing and language13861432Gemma 4 31B
LMArena Text: entertainment and media13691405Gemma 4 31B
LMArena Vision: EnglishNot measured1271Only Gemma 4 31B measured
LMArena Vision: ChineseNot measured1326Only Gemma 4 31B measured
LMArena Vision: reading textNot measured1282Only Gemma 4 31B measured
LMArena Vision: humorNot measured1280Only Gemma 4 31B measured
LMArena Vision: captioningNot measured1218Only Gemma 4 31B measured
LMArena Vision: recognizing thingsNot measured1226Only Gemma 4 31B measured
LMArena Vision: creative writingNot measured1285Only Gemma 4 31B measured
LMArena Document14201425Gemma 4 31B
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 Haiku 4.5 and Gemma 4 31B
BenchmarkClaude Haiku 4.5Gemma 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 Haiku 4.5$0.0035Fits in one request
Gemma 4 31B$0.0003Fits in one request

Gemma 4 31B costs less

Repository review

50K input + 3K output tokens

Claude Haiku 4.5$0.065Fits in one request
Gemma 4 31B$0.0082Fits in one request

Gemma 4 31B costs less

Agent loop

200K input + 10K output tokens

Claude Haiku 4.5$0.250Exceeds the context window
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 Haiku 4.5 and Gemma 4 31B
SpecificationAnthropic Claude Haiku 4.5Google Gemma 4 31B
MakerAnthropicGoogle
WeightsNo public weights listedOpen weights
ReleasedOctober 15, 2025April 2, 2026
Context window200K262K
Input $/Mtok$1.00$0.14
Output $/Mtok$5.00$0.40
Coding index35.639.0
Independent measurements behind it42
Cost per solved task$0.56Not computable
SourceOpenRouter listingOpenRouter listing

Questions

Is Claude Haiku 4.5 better than Gemma 4 31B for coding?

Pick Gemma 4 31B for coding: it scores 39.0 on the Vibe Coding Index against 35.6 for Claude Haiku 4.5, though on 2 benchmarks against 4. Pick Claude Haiku 4.5 for work measured by AA Coding Index or AA Intelligence Index, where it leads.

Which is cheaper, Claude Haiku 4.5 or Gemma 4 31B?

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

Which has the bigger context window, Claude Haiku 4.5 or Gemma 4 31B?

Gemma 4 31B, with 262K tokens against 200K.

How many benchmarks is the Claude Haiku 4.5 vs Gemma 4 31B comparison based on?

49 benchmarks have a result for both models as of October 22, 2026. Claude Haiku 4.5'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-haiku-4-5-vs-gemma-4-31b-it" title="Claude Haiku 4.5 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-haiku-4-5-vs-gemma-4-31b-it">LLMBenchmark.ai, Claude Haiku 4.5 vs Gemma 4 31B</a></p>