Claude Sonnet 4.5 vs Gemma 4 31B
Wins 4 of 8 areas
Coding · Agents · Facts · Long documents
Wins 4 of 8 areas
Reasoning · Images and charts · Math · Following instructions
The two are evenly matched.Claude Sonnet 4.5 is better at coding and facts; Gemma 4 31B at reasoning and images and charts.
Scores updated · 50 tests both models report · How we compare
Where each one wins
Tests won in each of the eight areas we test. Each piece is one test, so a longer bar means more evidence; grey means the two scored within a point of each other.
- CodingWriting and fixing software51Claude Sonnet 4.55 of 8 tests · 2 ties
- FactsGetting facts right instead of making them up31Claude Sonnet 4.53 of 4 tests
- AgentsCarrying out multi-step tasks on its own21Claude Sonnet 4.52 of 4 tests · 1 tie
- Long documentsFinding answers in very long texts10Claude Sonnet 4.51 of 1 test
- ReasoningHard problems that need careful thinking02Gemma 4 31B2 of 3 tests · 1 tie
- Images and chartsUnderstanding pictures, charts and video01Gemma 4 31B1 of 4 tests · 3 ties
- MathCompetition and research-level math01Gemma 4 31B1 of 1 test
- Following instructionsDoing exactly what it is asked01Gemma 4 31B1 of 1 test
Math, long documents and following instructions rest on a single test each.
What it costs
Prices per million tokens, roughly 750,000 words. The bars show the cost of a million tokens read plus a million written.
Gemma 4 31B costs 97% less for the same work.
The biggest differences
The three tests each model wins by the widest margin. Scores are out of 100.
Where Claude Sonnet 4.5 pulls ahead
- Avoids making up answers it doesn't knowAA-Omniscience · Non-hallucination+35.9points ahead
- Fixes real GitHub issues in Python projectsSWE-bench Verified+25.2points ahead
- Short factual questions, answered correctlySimpleQA Verified+20.3points ahead
Where Gemma 4 31B pulls ahead
- Follows unfamiliar, precisely checkable instructionsIFBench+18.3points ahead
- Recent programming contest problemsLiveCodeBench v6+16points ahead
- Multi-step tasks using many real software toolsMCP Atlas+13.4points ahead
Every test, side by side
All 50 tests both models report. The winning score is in its model's colour; marks a score checked independently.
CodingClaude Sonnet 4.5
- SWE-bench VerifiedClaude Sonnet 4.5 by 25.277.252+25.2
- LiveCodeBench v6Gemma 4 31B by 166480+16
- SWE-bench MultilingualClaude Sonnet 4.5 by 15.36751.7+15.3
- Terminal-Bench 2.1Claude Sonnet 4.5 by 12.455.843.4+12.4
- SWE-bench ProClaude Sonnet 4.5 by 7.943.635.7+7.9
- LMArena · WebDevClaude Sonnet 4.5 by 29 rating points13941365+29 rating
- Terminal-Bench Hardtie35.636.4tie
- SciCodetie45.745.5tie
AgentsClaude Sonnet 4.5
- GDPValClaude Sonnet 4.5 by 14.420.56.1+14.4
- MCP AtlasGemma 4 31B by 13.443.857.2+13.4
- τ-Bench V3 · BankingClaude Sonnet 4.5 by 9.724.514.8+9.7
- Terminal-Bench 4.0tie00tie
ReasoningGemma 4 31B
- Humanity's Last ExamGemma 4 31B by 5.817.823.6+5.8
- GPQA DiamondGemma 4 31B by 2.383.485.7+2.3
- CritPttie1.11.4tie
FactsClaude Sonnet 4.5
- AA-Omniscience · Non-hallucinationClaude Sonnet 4.5 by 35.950.915+35.9
- SimpleQA VerifiedClaude Sonnet 4.5 by 20.330.710.4+20.3
- AA-Omniscience · AccuracyClaude Sonnet 4.5 by 12.932.920+12.9
- Vectara HHEM hallucination ratelower is betterGemma 4 31B by 4.6127.4+4.6
Images and chartsGemma 4 31B
- MMMU-ProGemma 4 31B by 4.768.773.4+4.7
- MMMUtie79.680.4tie
- CharXiv (RQ)tie67.267.9tie
- MathVistatie79.879.3tie
Long documentsClaude Sonnet 4.5
- AA-LCRClaude Sonnet 4.5 by 2.672.369.7+2.6
Following instructionsGemma 4 31B
- IFBenchGemma 4 31B by 18.357.375.6+18.3
Other results24 tests, not counted
Tests outside the eight areas. They are not counted above: several are summary scores built from other tests, or the same test under another name.
- AA-OmniscienceClaude Sonnet 4.5 by 47.8-0.1-47.9+47.8
- HMMT Feb. 2025Gemma 4 31B by 21.267.588.7+21.2
- τ²-BenchClaude Sonnet 4.5 by 21.19876.9+21.1
- τ²-Bench Telecom (AA run)Claude Sonnet 4.5 by 18.278.159.9+18.2
- AA Agentic IndexClaude Sonnet 4.5 by 10.817.56.7+10.8
- Artificial Analysis Coding IndexClaude Sonnet 4.5 by 8.752.143.4+8.7
- CC-OCRGemma 4 31B by 7.668.175.7+7.6
- HallusionBenchGemma 4 31B by 7.559.967.4+7.5
- Terminal-Bench 2.0Claude Sonnet 4.5 by 7.15042.9+7.1
- AA IntelligenceClaude Sonnet 4.5 by 620.714.7+6
- HMMT Nov. 2025Gemma 4 31B by 5.881.787.5+5.8
- OmniDocBench 1.5Claude Sonnet 4.5 by 5.785.880.1+5.7
- HLE (with tools)Claude Sonnet 4.5 by 5.53226.5+5.5
- vectara_avg_summary_lengthClaude Sonnet 4.5 by 52 rating points127.875.8+52 rating
- SimpleVQAClaude Sonnet 4.5 by 4.757.652.9+4.7
- vectara_factual_consistencyGemma 4 31B by 4.68892.6+4.6
- vectara_answer_rateGemma 4 31B by 4.495.6100+4.4
- MMBench EN-DEV-v1.1Gemma 4 31B by 2.688.390.9+2.6
- MMLU-ProClaude Sonnet 4.5 by 2.387.585.2+2.3
- AI2DGemma 4 31B by 28789+2
- RealWorldQAGemma 4 31B by 270.372.3+2
- MMLU-ReduxClaude Sonnet 4.5 by 1.995.693.7+1.9
- GPQA (unspecified)tie83.484.3tie
- MMMLUtie89.188.4tie
Questions people ask
Which is better, Claude Sonnet 4.5 or Gemma 4 31B?
Claude Sonnet 4.5 and Gemma 4 31B each win four of the eight areas we test. Claude Sonnet 4.5 wins coding, agents, facts and long documents; Gemma 4 31B wins reasoning, images and charts, math and following instructions. Gemma 4 31B costs 97% less.
Which is better for coding?
Claude Sonnet 4.5. It wins 5 of the 8 coding tests both models report; Gemma 4 31B wins 1, and 2 are ties.
Which is cheaper?
Claude Sonnet 4.5 costs $3.00 per million input tokens and $15.00 per million output tokens; Gemma 4 31B costs $0.17 and $0.40. That makes Gemma 4 31B about 97% cheaper for the same work.
How do you compare the two?
We use the 50 benchmark tests both models have published scores on. The verdict counts the 26 tests in the eight capability areas, and a gap under one point (ten on rating-style scales) counts as a tie. The other 24 are listed but not counted, because several are summary scores or repeat a test. Each score is the one shown on the model's own page.