Enter opens the highlighted result. Esc closes.

Gemma 4 31B vs GPT-4.1 Mini

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

Gemma 4 31BGoogle
Coding
38.3
Overall
14.7
Output $/M
$0.40
49
GPT-4.1 MiniOpenAI
Coding
28.5
Overall
10.2
Output $/M
$1.60
2
vs boards won of 51 shared

Decision reading

Pick Gemma 4 31B for coding: it scores 38.3 on the Vibe Coding Index against 28.5 for GPT-4.1 Mini.

Pick GPT-4.1 Mini when the context window is larger, 1.05M against 262K tokens, or when what matters is MortgageTax (Vals AI) or SimpleQA Verified, where it leads.

Shared results
51
Gemma 4 31B only
17
GPT-4.1 Mini only
33
Like-for-like categories
7 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
Gemma 4 31B 38.3 from 2 benchmarks, GPT-4.1 Mini 28.5 from 2 benchmarks.
Widest category
Math, 22.8 points apart on average over 3 shared benchmarks.
Widest single gap
IFBench: Gemma 4 31B 75.6% against GPT-4.1 Mini 38.3%, 37.3 points apart on a 0 to 100 scale.
Output price
Gemma 4 31B $0.40 against GPT-4.1 Mini $1.60 per million output tokens, 4.0x apart.
Context window
Gemma 4 31B takes 262K tokens, GPT-4.1 Mini 1.05M.

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-4.1 MiniTies
Coding50
Intelligence20
Agentic work10
Reasoning80
Math30
Knowledge42
General260
All shared boards492
CodingLike-for-likeFour of these boards feed the Vibe Coding Index50
Coding benchmarks for Gemma 4 31B and GPT-4.1 Mini
BenchmarkGemma 4 31BGPT-4.1 MiniLeader
Aider polyglotNot measured32.4%Only GPT-4.1 Mini measured
SWE-bench VerifiedNot measured23.9%Only GPT-4.1 Mini measured
LiveBench coding49.0%Not measuredOnly Gemma 4 31B measured
LMArena WebDev1367Not measuredOnly Gemma 4 31B measured
AA Coding Index43.420.2Gemma 4 31B
LiveCodeBench (Vals AI)Not measured58.2%Only GPT-4.1 Mini measured
LiveCodeBench (Artificial Analysis run)Not measured48.3%Only GPT-4.1 Mini measured
SciCode45.5%Not measuredOnly Gemma 4 31B measured
Terminal-Bench Hard (Artificial Analysis run)36.4%7.6%Gemma 4 31B
WeirdML52.3%37.6%Gemma 4 31B
ALE-Bench925.5Not measuredOnly Gemma 4 31B measured
LMArena Text: coding14591367Gemma 4 31B
LMArena Text: software and IT14631360Gemma 4 31B
LMArena WebDev: React1359Not measuredOnly Gemma 4 31B measured
LMArena WebDev: HTML1380Not measuredOnly Gemma 4 31B measured
Neither model has a result on the other 23 boards here
IntelligenceLike-for-likePublic boards, shown as published, kept out of the index20
Intelligence benchmarks for Gemma 4 31B and GPT-4.1 Mini
BenchmarkGemma 4 31BGPT-4.1 MiniLeader
AA Intelligence Index14.710.2Gemma 4 31B
Epoch Capabilities Index143.0134.9Gemma 4 31B
Agentic workLike-for-likePublic boards, shown as published, kept out of the index10
Agentic work benchmarks for Gemma 4 31B and GPT-4.1 Mini
BenchmarkGemma 4 31BGPT-4.1 MiniLeader
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%52.9%Gemma 4 31B
Neither model has a result on the other 34 boards here
ReasoningLike-for-likePublic boards, shown as published, kept out of the index80
Reasoning benchmarks for Gemma 4 31B and GPT-4.1 Mini
BenchmarkGemma 4 31BGPT-4.1 MiniLeader
GPQA DiamondNot measured67.9%Only GPT-4.1 Mini measured
LiveBench reasoning68.3%Not measuredOnly Gemma 4 31B measured
MMMU Pro (Vals AI)Not measured70.5%Only GPT-4.1 Mini measured
GPQA Diamond (Artificial Analysis run)85.7%66.4%Gemma 4 31B
Humanity's Last Exam (Artificial Analysis run)23.6%5.0%Gemma 4 31B
GPQA Diamond (Epoch AI run)75.8%65.8%Gemma 4 31B
ARC-AGINot measured3.5%Only GPT-4.1 Mini measured
ARC-AGI-2Not measured0.0%Only GPT-4.1 Mini measured
Chess puzzlesNot measured1.0%Only GPT-4.1 Mini measured
Mystery game puzzlesNot measured7.0%Only GPT-4.1 Mini measured
LMArena Text: hard prompts14481349Gemma 4 31B
LMArena Text: expert14641338Gemma 4 31B
LMArena Text: hard prompts in English14561362Gemma 4 31B
LMArena Vision: diagrams12831182Gemma 4 31B
LMArena Vision: homework13101214Gemma 4 31B
Neither model has a result on the other 6 boards here
MathLike-for-likePublic boards, shown as published, kept out of the index30
Math benchmarks for Gemma 4 31B and GPT-4.1 Mini
BenchmarkGemma 4 31BGPT-4.1 MiniLeader
AIMENot measured49.4%Only GPT-4.1 Mini measured
MATH 500 (Vals AI)Not measured88.0%Only GPT-4.1 Mini measured
MGSM (Vals AI)Not measured87.8%Only GPT-4.1 Mini measured
AA Math IndexNot measured46.3Only GPT-4.1 Mini measured
AIME 2025 (Artificial Analysis run)Not measured46.3%Only GPT-4.1 Mini measured
OTIS Mock AIME73.3%44.7%Gemma 4 31B
FrontierMath, tiers 1 to 3Not measured6.7%Only GPT-4.1 Mini measured
MATH level 5Not measured87.3%Only GPT-4.1 Mini measured
LMArena Text: math14631343Gemma 4 31B
LMArena Text: mathematical work14651347Gemma 4 31B
Neither model has a result on the other 3 boards here
KnowledgeLike-for-likePublic boards, shown as published, kept out of the index42
Knowledge benchmarks for Gemma 4 31B and GPT-4.1 Mini
BenchmarkGemma 4 31BGPT-4.1 MiniLeader
MMLU ProNot measured77.2%Only GPT-4.1 Mini measured
LegalBench (Vals AI)Not measured78.0%Only GPT-4.1 Mini measured
CaseLaw (Vals AI)52.6%Not measuredOnly Gemma 4 31B measured
CorpFin (Vals AI)Not measured57.9%Only GPT-4.1 Mini measured
TaxEval (Vals AI)Not measured71.9%Only GPT-4.1 Mini measured
MortgageTax (Vals AI)61.4%65.5%GPT-4.1 Mini
MedQA (Vals AI)Not measured84.6%Only GPT-4.1 Mini measured
MMLU Pro (Artificial Analysis run)Not measured78.1%Only GPT-4.1 Mini measured
SimpleQA Verified10.4%12.7%GPT-4.1 Mini
LMArena Text: science14571328Gemma 4 31B
LMArena Text: medicine and healthcare14511324Gemma 4 31B
LMArena Text: legal and government14381343Gemma 4 31B
LMArena Text: business and finance14301322Gemma 4 31B
Neither model has a result on the other 4 boards here
Web designDirectional onlyPublic boards, shown as published, kept out of the index7 boards, none shared
Web design benchmarks for Gemma 4 31B and GPT-4.1 Mini
BenchmarkGemma 4 31BGPT-4.1 MiniLeader
Design Arena: websitesNot measured997Only GPT-4.1 Mini measured
Design Arena: UI componentsNot measured961Only GPT-4.1 Mini measured
Design Arena: game devNot measured1071Only GPT-4.1 Mini measured
Design Arena: data vizNot measured1034Only GPT-4.1 Mini measured
Design Arena: 3DNot measured837Only GPT-4.1 Mini measured
Design Arena: all code categoriesNot measured994Only GPT-4.1 Mini measured
LiveBench design58.4%Not measuredOnly Gemma 4 31B measured
Neither model has a result on the other 2 boards here
GeneralLike-for-likePublic boards, shown as published, kept out of the index260
General benchmarks for Gemma 4 31B and GPT-4.1 Mini
BenchmarkGemma 4 31BGPT-4.1 MiniLeader
LiveBench data analysis53.3%Not measuredOnly Gemma 4 31B measured
SAGE (Vals AI)55.0%Not measuredOnly Gemma 4 31B measured
IFBench75.6%38.3%Gemma 4 31B
Long context reasoning (AA-LCR)69.7%44.0%Gemma 4 31B
DTBench82.7%68.8%Gemma 4 31B
LMCA39.3%21.1%Gemma 4 31B
Fiction.LiveBenchNot measured44.4%Only GPT-4.1 Mini measured
Surface Evolver Bench30.6%Not measuredOnly Gemma 4 31B measured
LMArena Text14431341Gemma 4 31B
LMArena Text: instruction following14331333Gemma 4 31B
LMArena Text: creative writing14171299Gemma 4 31B
LMArena Vision12761181Gemma 4 31B
LMArena Text: English14511356Gemma 4 31B
LMArena Text: non-English14301318Gemma 4 31B
LMArena Text: Chinese14751329Gemma 4 31B
LMArena Text: GermanNot measured1350Only GPT-4.1 Mini measured
LMArena Text: JapaneseNot measured1290Only GPT-4.1 Mini measured
LMArena Text: KoreanNot measured1298Only GPT-4.1 Mini measured
LMArena Text: French14361358Gemma 4 31B
LMArena Text: Spanish14421319Gemma 4 31B
LMArena Text: Russian14601324Gemma 4 31B
LMArena Text: Polish14331326Gemma 4 31B
LMArena Text: multi-turn14521354Gemma 4 31B
LMArena Text: longer queries14461344Gemma 4 31B
LMArena Text: writing and language14321319Gemma 4 31B
LMArena Text: entertainment and media14051300Gemma 4 31B
LMArena Vision: English12711191Gemma 4 31B
LMArena Vision: Chinese13261186Gemma 4 31B
LMArena Vision: reading text12821188Gemma 4 31B
LMArena Vision: humor12801182Gemma 4 31B
LMArena Vision: captioning12181174Gemma 4 31B
LMArena Vision: recognizing things12261187Gemma 4 31B
LMArena Vision: creative writing12851182Gemma 4 31B
LMArena Document1425Not measuredOnly Gemma 4 31B measured
Neither model has a result on the other 12 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-4.1 Mini
BenchmarkGemma 4 31BGPT-4.1 MiniLeader
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.0004Fits in one request
GPT-4.1 Mini$0.0012Fits in one request

Gemma 4 31B costs less

Repository review

50K input + 3K output tokens

Gemma 4 31B$0.011Fits in one request
GPT-4.1 Mini$0.025Fits in one request

Gemma 4 31B costs less

Agent loop

200K input + 10K output tokens

Gemma 4 31B$0.044Fits in one request
GPT-4.1 Mini$0.096Fits 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-4.1 Mini
SpecificationGoogle Gemma 4 31BOpenAI GPT-4.1 Mini
MakerGoogleOpenAI
WeightsOpen weightsNo public weights listed
ReleasedApril 2, 2026April 14, 2025
Context window262K1.05M
Input $/Mtok$0.20$0.40
Output $/Mtok$0.40$1.60
Coding index38.328.5
Independent measurements behind it22
Cost per solved taskNot computable$1.818
SourceOpenRouter listingOpenRouter listing

Questions

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

Pick Gemma 4 31B for coding: it scores 38.3 on the Vibe Coding Index against 28.5 for GPT-4.1 Mini. Pick GPT-4.1 Mini when the context window is larger, 1.05M against 262K tokens, or when what matters is MortgageTax (Vals AI) or SimpleQA Verified, where it leads.

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

Gemma 4 31B costs $0.20 per million input tokens and $0.40 per million output tokens; GPT-4.1 Mini costs $0.40 and $1.60. Cost per solved task is known for GPT-4.1 Mini only.

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

GPT-4.1 Mini, with 1.05M tokens against 262K.

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

51 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-4.1 Mini'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/gemma-4-31b-it-vs-gpt-4-1-mini" title="Gemma 4 31B vs GPT-4.1 Mini, 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-4-1-mini">LLMBenchmark.ai, Gemma 4 31B vs GPT-4.1 Mini</a></p>