Enter opens the highlighted result. Esc closes.

Gemma 2 27B vs Gemma 4 31B

Gemma 4 31B costs 1.6x less per output token than Gemma 2 27B ($0.40 vs $0.65 per million). Updated October 22, 2026; 30 benchmarks have a result for both.

Gemma 2 27BGoogle
Coding
No data
Overall
No data
Output $/M
$0.65
0
Gemma 4 31BGoogle
Coding
39.0
Overall
42.1
Output $/M
$0.40
30
vs boards won of 30 shared

Gemma 2 27B or Gemma 4 31B: which to pick

Only Gemma 4 31B has a coding score, 39.0 on the Vibe Coding Index; Gemma 2 27B has none, so the two cannot be ranked on coding.

Compare them on price, context and the boards below.

Shared results
30
Gemma 2 27B only
6
Gemma 4 31B only
41
Like-for-like categories
6 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 2 27B not benchmarked, Gemma 4 31B 39.0 from 2 benchmarks.
Widest category
Math, 51.4 points apart on average over 3 shared benchmarks.
Widest single gap
OTIS Mock AIME: Gemma 2 27B 1.4% against Gemma 4 31B 73.3%, 71.9 points apart on a 0 to 100 scale.
Output price
Gemma 2 27B $0.65 against Gemma 4 31B $0.40 per million output tokens, 1.6x apart.
Context window
Gemma 2 27B takes 8K 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
CategoryGemma 2 27BBarsGemma 4 31BTies
Coding02
Intelligence01
Reasoning04
Math03
Knowledge04
General016
All shared boards030
CodingLike-for-likeSix of these boards feed the Vibe Coding Index02
Coding benchmarks for Gemma 2 27B and Gemma 4 31B
BenchmarkGemma 2 27BGemma 4 31BLeader
LiveBench codingNot measured49.0%Only Gemma 4 31B measured
LMArena WebDevNot measured1367Only Gemma 4 31B measured
AA Coding IndexNot measured43.4Only Gemma 4 31B measured
SciCodeNot measured45.5%Only Gemma 4 31B measured
Terminal-Bench Hard (Artificial Analysis run)Not measured36.4%Only Gemma 4 31B measured
WeirdMLNot measured52.3%Only Gemma 4 31B measured
ALE-BenchNot measured925.5Only Gemma 4 31B measured
LMArena Text: coding12111459Gemma 4 31B
LMArena Text: software and IT12281463Gemma 4 31B
LMArena WebDev: ReactNot measured1359Only Gemma 4 31B measured
LMArena WebDev: HTMLNot measured1380Only Gemma 4 31B measured
SciCodeNot measured8.9%Only Gemma 4 31B measured
Neither model has a result on the other 27 boards here
IntelligenceLike-for-likePublic boards, shown as published, kept out of the index01
Intelligence benchmarks for Gemma 2 27B and Gemma 4 31B
BenchmarkGemma 2 27BGemma 4 31BLeader
AA Intelligence IndexNot measured14.7Only Gemma 4 31B measured
Epoch Capabilities Index122.1143.0Gemma 4 31B
Agentic workDirectional onlyPublic boards, shown as published, kept out of the index5 boards, none shared
Agentic work benchmarks for Gemma 2 27B and Gemma 4 31B
BenchmarkGemma 2 27BGemma 4 31BLeader
AA Agentic IndexNot measured4.2Only Gemma 4 31B measured
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
τ²-Bench TelecomNot measured65.5%Only Gemma 4 31B measured
Neither model has a result on the other 36 boards here
ReasoningLike-for-likePublic boards, shown as published, kept out of the index04
Reasoning benchmarks for Gemma 2 27B and Gemma 4 31B
BenchmarkGemma 2 27BGemma 4 31BLeader
LiveBench reasoningNot measured68.3%Only Gemma 4 31B 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)36.5%75.8%Gemma 4 31B
LMArena Text: hard prompts11981448Gemma 4 31B
LMArena Text: expert11711464Gemma 4 31B
LMArena Text: hard prompts in English12061456Gemma 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 12 boards here
MathLike-for-likePublic boards, shown as published, kept out of the index03
Math benchmarks for Gemma 2 27B and Gemma 4 31B
BenchmarkGemma 2 27BGemma 4 31BLeader
OTIS Mock AIME1.4%73.3%Gemma 4 31B
MATH level 527.9%Not measuredOnly Gemma 2 27B measured
LMArena Text: math12121463Gemma 4 31B
LMArena Text: mathematical work12211465Gemma 4 31B
Neither model has a result on the other 9 boards here
KnowledgeLike-for-likePublic boards, shown as published, kept out of the index04
Knowledge benchmarks for Gemma 2 27B and Gemma 4 31B
BenchmarkGemma 2 27BGemma 4 31BLeader
LegalBench (Vals AI)68.0%Not measuredOnly Gemma 2 27B measured
CaseLaw (Vals AI)Not measured52.6%Only Gemma 4 31B measured
MortgageTax (Vals AI)Not measured61.4%Only Gemma 4 31B measured
SimpleQA VerifiedNot measured10.4%Only Gemma 4 31B measured
MMLU75.7%Not measuredOnly Gemma 2 27B measured
LMArena Text: science12281457Gemma 4 31B
LMArena Text: medicine and healthcare11981451Gemma 4 31B
LMArena Text: legal and government12411438Gemma 4 31B
LMArena Text: business and finance12081430Gemma 4 31B
FACTS Benchmark SuiteNot measured45.3%Only Gemma 4 31B measured
Neither model has a result on the other 8 boards here
Web designDirectional onlyPublic boards, shown as published, kept out of the index1 board, none shared
Web design benchmarks for Gemma 2 27B and Gemma 4 31B
BenchmarkGemma 2 27BGemma 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 index016
General benchmarks for Gemma 2 27B and Gemma 4 31B
BenchmarkGemma 2 27BGemma 4 31BLeader
LiveBench data analysisNot measured53.3%Only Gemma 4 31B measured
SAGE (Vals AI)Not measured55.0%Only Gemma 4 31B measured
IFBenchNot measured75.6%Only Gemma 4 31B measured
Long context reasoning (AA-LCR)Not measured69.7%Only Gemma 4 31B measured
DTBench48.0%82.7%Gemma 4 31B
LMCA7.1%39.3%Gemma 4 31B
Surface Evolver BenchNot measured30.6%Only Gemma 4 31B measured
LMArena Text12311443Gemma 4 31B
LMArena Text: instruction following12061433Gemma 4 31B
LMArena Text: creative writing12401417Gemma 4 31B
LMArena VisionNot measured1276Only Gemma 4 31B measured
LMArena Text: English12421451Gemma 4 31B
LMArena Text: non-English12171430Gemma 4 31B
LMArena Text: Chinese12211475Gemma 4 31B
LMArena Text: German1209Not measuredOnly Gemma 2 27B measured
LMArena Text: Japanese1175Not measuredOnly Gemma 2 27B measured
LMArena Text: Korean1174Not measuredOnly Gemma 2 27B measured
LMArena Text: French12481436Gemma 4 31B
LMArena Text: Spanish12281442Gemma 4 31B
LMArena Text: Russian12341460Gemma 4 31B
LMArena Text: Polish12771433Gemma 4 31B
LMArena Text: multi-turn12241452Gemma 4 31B
LMArena Text: longer queries12301446Gemma 4 31B
LMArena Text: writing and language12491432Gemma 4 31B
LMArena Text: entertainment and media12121405Gemma 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 DocumentNot measured1425Only Gemma 4 31B measured
Neither model has a result on the other 13 boards here
Image generationNot comparablePublic boards, shown as published, kept out of the index0 boards, none shared
Image generation benchmarks for Gemma 2 27B and Gemma 4 31B
BenchmarkGemma 2 27BGemma 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

Gemma 2 27B$0.0010Fits in one request
Gemma 4 31B$0.0003Fits in one request

Gemma 4 31B costs less

Repository review

50K input + 3K output tokens

Gemma 2 27B$0.034Exceeds the context window
Gemma 4 31B$0.0082Fits in one request

Gemma 4 31B costs less

Agent loop

200K input + 10K output tokens

Gemma 2 27B$0.137Exceeds 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 Gemma 2 27B and Gemma 4 31B
SpecificationGoogle Gemma 2 27BGoogle Gemma 4 31B
MakerGoogleGoogle
WeightsOpen weightsOpen weights
ReleasedJuly 13, 2024April 2, 2026
Context window8K262K
Input $/Mtok$0.65$0.14
Output $/Mtok$0.65$0.40
Coding indexNot benchmarked39.0
Independent measurements behind it02
Cost per solved taskNot computableNot computable
SourceOpenRouter listingOpenRouter listing

Questions

Is Gemma 2 27B better than Gemma 4 31B for coding?

Only Gemma 4 31B has a coding score, 39.0 on the Vibe Coding Index; Gemma 2 27B has none, so the two cannot be ranked on coding. Compare them on price, context and the boards below.

Which is cheaper, Gemma 2 27B or Gemma 4 31B?

Gemma 2 27B costs $0.65 per million input tokens and $0.65 per million output tokens; Gemma 4 31B costs $0.14 and $0.40. Cost per solved task is known for neither of them.

Which has the bigger context window, Gemma 2 27B or Gemma 4 31B?

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

How many benchmarks is the Gemma 2 27B vs Gemma 4 31B comparison based on?

30 benchmarks have a result for both models as of October 22, 2026. Gemma 2 27B's coding index rests on 0 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