Enter opens the highlighted result. Esc closes.

Gemma 4 31B vs GPT-5.1

GPT-5.1 leads Gemma 4 31B on coding, 40.4 to 39.0 on the Vibe Coding Index, and Gemma 4 31B costs 25.0x less per output token ($0.40 vs $10.00 per million). Updated October 21, 2026; 58 benchmarks have a result for both.

Gemma 4 31BGoogle
Coding
39.0
Overall
42.1
Output $/M
$0.40
22
GPT-5.1OpenAI
Coding
40.4
Overall
55.0
Output $/M
$10.00
35
vs boards won of 58 shared, 1 tied

Gemma 4 31B or GPT-5.1: which to pick

Gemma 4 31B and GPT-5.1 are level for coding, 39.0 against 40.4 on the Vibe Coding Index, so price and context decide.

Pick Gemma 4 31B for output tokens 25.0x cheaper ($0.40 vs $10.00 per million) and work measured by LMArena Text: coding or LMArena Text: software and IT, where it leads. Pick GPT-5.1 for a larger context window (400K against 262K tokens) and work measured by LMArena WebDev or AA Coding Index, where it leads.

Shared results
58
Gemma 4 31B only
13
GPT-5.1 only
43
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
Gemma 4 31B 39.0 from 2 benchmarks, GPT-5.1 40.4 from 3 benchmarks.
Widest category
Agentic work, 16.4 points apart on average over 1 shared benchmark.
Widest single gap
SimpleQA Verified: Gemma 4 31B 10.4% against GPT-5.1 48.0%, 37.6 points apart on a 0 to 100 scale.
Output price
Gemma 4 31B $0.40 against GPT-5.1 $10.00 per million output tokens, 25.0x apart.
Context window
Gemma 4 31B takes 262K tokens, GPT-5.1 400K.

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
CategoryGemma 4 31BBarsGPT-5.1Ties
Coding35
Intelligence02
Agentic work01
Reasoning26
Math21
Knowledge161 tie
General1414
All shared boards22351 tie
CodingLike-for-likeSix of these boards feed the Vibe Coding Index35
Coding benchmarks for Gemma 4 31B and GPT-5.1
BenchmarkGemma 4 31BGPT-5.1Leader
SWE-bench VerifiedNot measured66.0%Only GPT-5.1 measured
LiveBench coding49.0%Not measuredOnly Gemma 4 31B measured
LMArena WebDev13671396GPT-5.1
AA Coding Index43.449.4GPT-5.1
LiveCodeBench (Vals AI)Not measured86.5%Only GPT-5.1 measured
SWE-bench Verified (Vals AI)Not measured69.8%Only GPT-5.1 measured
Vibe Code Bench (Vals AI)Not measured24.6%Only GPT-5.1 measured
LiveCodeBench (Artificial Analysis run)Not measured86.8%Only GPT-5.1 measured
SciCode45.5%Not measuredOnly Gemma 4 31B measured
Terminal-Bench Hard (Artificial Analysis run)36.4%45.5%GPT-5.1
Terminal-BenchNot measured47.6%Only GPT-5.1 measured
GSO-BenchNot measured13.7%Only GPT-5.1 measured
WeirdML52.3%60.8%GPT-5.1
ALE-Bench925.5Not measuredOnly Gemma 4 31B measured
LMArena Text: coding14591453Gemma 4 31B
LMArena Text: software and IT14631454Gemma 4 31B
LMArena WebDev: React13591307Gemma 4 31B
LMArena WebDev: HTML13801405GPT-5.1
LMArena WebDev: from an imageNot measured1421Only GPT-5.1 measured
SciCode8.9%Not measuredOnly Gemma 4 31B measured
Neither model has a result on the other 19 boards here
IntelligenceLike-for-likePublic boards, shown as published, kept out of the index02
Intelligence benchmarks for Gemma 4 31B and GPT-5.1
BenchmarkGemma 4 31BGPT-5.1Leader
AA Intelligence Index14.724.7GPT-5.1
Epoch Capabilities Index143.0149.8GPT-5.1
Agentic workLike-for-likePublic boards, shown as published, kept out of the index01
Agentic work benchmarks for Gemma 4 31B and GPT-5.1
BenchmarkGemma 4 31BGPT-5.1Leader
AA Agentic Index4.2Not measuredOnly Gemma 4 31B measured
LiveBench research44.4%Not measuredOnly Gemma 4 31B measured
LiveBench browser4.0%Not measuredOnly Gemma 4 31B measured
LiveBench long agentic13.3%Not measuredOnly Gemma 4 31B measured
τ²-Bench Telecom65.5%81.9%GPT-5.1
DeepResearch BenchNot measured42.8%Only GPT-5.1 measured
Vending-Bench 2Not measured$1,473Only GPT-5.1 measured
Neither model has a result on the other 34 boards here
ReasoningLike-for-likePublic boards, shown as published, kept out of the index26
Reasoning benchmarks for Gemma 4 31B and GPT-5.1
BenchmarkGemma 4 31BGPT-5.1Leader
GPQA DiamondNot measured86.6%Only GPT-5.1 measured
LiveBench reasoning68.3%Not measuredOnly Gemma 4 31B measured
MMMU Pro (Vals AI)Not measured83.2%Only GPT-5.1 measured
GPQA Diamond (Artificial Analysis run)85.7%87.3%GPT-5.1
Humanity's Last Exam (Artificial Analysis run)23.6%28.5%GPT-5.1
GPQA Diamond (Epoch AI run)75.8%87.6%GPT-5.1
ARC-AGINot measured72.8%Only GPT-5.1 measured
ARC-AGI-2Not measured17.6%Only GPT-5.1 measured
SimpleBenchNot measured53.2%Only GPT-5.1 measured
Chess puzzlesNot measured42.0%Only GPT-5.1 measured
Mystery game puzzlesNot measured19.0%Only GPT-5.1 measured
VPCTNot measured58.7%Only GPT-5.1 measured
LMArena Text: hard prompts14481457GPT-5.1
LMArena Text: expert14641470GPT-5.1
LMArena Text: hard prompts in English14561462GPT-5.1
LMArena Vision: diagrams12831264Gemma 4 31B
LMArena Vision: homework13101272Gemma 4 31B
Kagi LLM Benchmark63.5%Not measuredOnly Gemma 4 31B measured
Neither model has a result on the other 4 boards here
MathLike-for-likePublic boards, shown as published, kept out of the index21
Math benchmarks for Gemma 4 31B and GPT-5.1
BenchmarkGemma 4 31BGPT-5.1Leader
AIMENot measured93.3%Only GPT-5.1 measured
MGSM (Vals AI)Not measured93.0%Only GPT-5.1 measured
AA Math IndexNot measured94.0Only GPT-5.1 measured
AIME 2025 (Artificial Analysis run)Not measured94.0%Only GPT-5.1 measured
OTIS Mock AIME73.3%88.6%GPT-5.1
LMArena Text: math14631446Gemma 4 31B
LMArena Text: mathematical work14651449Gemma 4 31B
Neither model has a result on the other 6 boards here
KnowledgeLike-for-likePublic boards, shown as published, kept out of the index16
Knowledge benchmarks for Gemma 4 31B and GPT-5.1
BenchmarkGemma 4 31BGPT-5.1Leader
MMLU ProNot measured86.4%Only GPT-5.1 measured
LegalBench (Vals AI)Not measured85.7%Only GPT-5.1 measured
CaseLaw (Vals AI)52.6%73.4%GPT-5.1
CorpFin (Vals AI)Not measured63.8%Only GPT-5.1 measured
TaxEval (Vals AI)Not measured74.9%Only GPT-5.1 measured
MortgageTax (Vals AI)61.4%61.4%Tie
MedQA (Vals AI)Not measured96.4%Only GPT-5.1 measured
MedCode (Vals AI)Not measured52.7%Only GPT-5.1 measured
MMLU Pro (Artificial Analysis run)Not measured87.0%Only GPT-5.1 measured
SimpleQA Verified10.4%48.0%GPT-5.1
LMArena Text: science14571459GPT-5.1
LMArena Text: medicine and healthcare14511456GPT-5.1
LMArena Text: legal and government14381459GPT-5.1
LMArena Text: business and finance14301431GPT-5.1
FACTS Benchmark Suite45.3%45.0%Gemma 4 31B
Neither model has a result on the other 3 boards here
Web designDirectional onlyPublic boards, shown as published, kept out of the index9 boards, none shared
Web design benchmarks for Gemma 4 31B and GPT-5.1
BenchmarkGemma 4 31BGPT-5.1Leader
Design Arena: websitesNot measured1187Only GPT-5.1 measured
Design Arena: UI componentsNot measured1166Only GPT-5.1 measured
Design Arena: game devNot measured1179Only GPT-5.1 measured
Design Arena: data vizNot measured1204Only GPT-5.1 measured
Design Arena: 3DNot measured1061Only GPT-5.1 measured
Design Arena: all code categoriesNot measured1171Only GPT-5.1 measured
Design Arena: SVGNot measured1149Only GPT-5.1 measured
Design Arena: ASCII artNot measured1119Only GPT-5.1 measured
LiveBench design58.4%Not measuredOnly Gemma 4 31B measured
GeneralLike-for-likePublic boards, shown as published, kept out of the index1414
General benchmarks for Gemma 4 31B and GPT-5.1
BenchmarkGemma 4 31BGPT-5.1Leader
LiveBench data analysis53.3%Not measuredOnly Gemma 4 31B measured
SAGE (Vals AI)55.0%43.2%Gemma 4 31B
MedScribe (Vals AI)Not measured88.1%Only GPT-5.1 measured
IFBench75.6%72.9%Gemma 4 31B
Long context reasoning (AA-LCR)69.7%80.0%GPT-5.1
DTBench82.7%90.1%GPT-5.1
LMCA39.3%43.9%GPT-5.1
CL-benchNot measured23.7%Only GPT-5.1 measured
Surface Evolver Bench30.6%Not measuredOnly Gemma 4 31B measured
CL-bench LifeNot measured17.3%Only GPT-5.1 measured
LMArena Text14431443GPT-5.1
LMArena Text: instruction following14331443GPT-5.1
LMArena Text: creative writing14171427GPT-5.1
LMArena Vision12761250Gemma 4 31B
LMArena Text: English14511451Gemma 4 31B
LMArena Text: non-English14301431GPT-5.1
LMArena Text: Chinese14751495GPT-5.1
LMArena Text: GermanNot measured1438Only GPT-5.1 measured
LMArena Text: JapaneseNot measured1453Only GPT-5.1 measured
LMArena Text: KoreanNot measured1401Only GPT-5.1 measured
LMArena Text: French14361450GPT-5.1
LMArena Text: Spanish14421433Gemma 4 31B
LMArena Text: Russian14601435Gemma 4 31B
LMArena Text: Polish14331440GPT-5.1
LMArena Text: multi-turn14521450Gemma 4 31B
LMArena Text: longer queries14461448GPT-5.1
LMArena Text: writing and language14321428Gemma 4 31B
LMArena Text: entertainment and media14051415GPT-5.1
LMArena Vision: English12711252Gemma 4 31B
LMArena Vision: Chinese13261270Gemma 4 31B
LMArena Vision: reading text12821255Gemma 4 31B
LMArena Vision: humor12801263Gemma 4 31B
LMArena Vision: captioning12181252GPT-5.1
LMArena Vision: recognizing things12261232GPT-5.1
LMArena Vision: creative writing12851266Gemma 4 31B
LMArena Document14251403Gemma 4 31B
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 Gemma 4 31B and GPT-5.1
BenchmarkGemma 4 31BGPT-5.1Leader
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

Gemma 4 31B$0.0003Fits in one request
GPT-5.1$0.0063Fits in one request

Gemma 4 31B costs less

Repository review

50K input + 3K output tokens

Gemma 4 31B$0.0082Fits in one request
GPT-5.1$0.092Fits in one request

Gemma 4 31B costs less

Agent loop

200K input + 10K output tokens

Gemma 4 31B$0.032Fits in one request
GPT-5.1$0.350Fits 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 Gemma 4 31B and GPT-5.1
SpecificationGoogle Gemma 4 31BOpenAI GPT-5.1
MakerGoogleOpenAI
WeightsOpen weightsNo public weights listed
ReleasedApril 2, 2026November 13, 2025
Context window262K400K
Input $/Mtok$0.14$1.25
Output $/Mtok$0.40$10.00
Coding index39.040.4
Independent measurements behind it23
Cost per solved taskNot computable$1.02
SourceOpenRouter listingOpenRouter listing

Questions

Is Gemma 4 31B better than GPT-5.1 for coding?

Gemma 4 31B and GPT-5.1 are level for coding, 39.0 against 40.4 on the Vibe Coding Index, so price and context decide. Pick Gemma 4 31B for output tokens 25.0x cheaper ($0.40 vs $10.00 per million) and work measured by LMArena Text: coding or LMArena Text: software and IT, where it leads. Pick GPT-5.1 for a larger context window (400K against 262K tokens) and work measured by LMArena WebDev or AA Coding Index, where it leads.

Which is cheaper, Gemma 4 31B or GPT-5.1?

Gemma 4 31B costs $0.14 per million input tokens and $0.40 per million output tokens; GPT-5.1 costs $1.25 and $10.00. Cost per solved task is known for GPT-5.1 only.

Which has the bigger context window, Gemma 4 31B or GPT-5.1?

GPT-5.1, with 400K tokens against 262K.

How many benchmarks is the Gemma 4 31B vs GPT-5.1 comparison based on?

58 benchmarks have a result for both models as of October 21, 2026. Gemma 4 31B's coding index rests on 2 independent benchmarks and GPT-5.1's on 3. 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/gemma-4-31b-it-vs-gpt-5-1" title="Gemma 4 31B vs GPT-5.1, 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/gemma-4-31b-it-vs-gpt-5-1">LLMBenchmark.ai, Gemma 4 31B vs GPT-5.1</a></p>