head-to-head

Google: Gemma 4 31B (free) vs xAI: Grok 4.20

Side-by-side comparison of specs, pricing, benchmark scores, and task rankings. Updated 2026-06-20.

Google: Gemma 4 31B (free) xAI: Grok 4.20
Vendorgooglex-ai
Quality Score100100
Benchmark Score-61.5
Input PriceFree$1.25/M
Output PriceFree$2.50/M
Context Window262,1442,000,000
Max Output8,192-
Tool Calling
Structured Output
Reasoning Mode
Vision
Audio--
Benchmark Scores
ai_index-61.0
eqbench-55.8

Who wins by task?

TaskGoogle: Gemma 4 31B (free)xAI: Grok 4.20
SQL Generation 131 144
Code Review 126 150
Code Completion 129 122
Code Refactoring 127 153
Bug Fixing 130 154
Unit Test Generation 121 135
Code Documentation 126 141
Regex Writing 120 127
CI/CD Pipelines 117 131
Frontend Component Design 122 131
Data Analysis 124 136
CSV / Spreadsheet Cleanup 128 139
ETL Scripting 122 142
JSON Extraction 132 123
Bulk Data Labeling 130 120
OCR / Document Parsing 128 135
Table Extraction from PDFs 128 135
Long-Document Summarization 129 154
Short-Form Summarization 124 119
Blog Post Writing 119 132

Scores reflect capability match + benchmark data + pricing for each task. Methodology →

Related comparisons

MoonshotAI: Kimi K2.7 Code vs Google: Gemma 4 31B (free) MoonshotAI: Kimi K2.7 Code vs xAI: Grok 4.20 Qwen: Qwen3.7 Plus vs Google: Gemma 4 31B (free) Qwen: Qwen3.7 Plus vs xAI: Grok 4.20 MiniMax: MiniMax M3 vs Google: Gemma 4 31B (free) MiniMax: MiniMax M3 vs xAI: Grok 4.20 StepFun: Step 3.7 Flash vs Google: Gemma 4 31B (free) StepFun: Step 3.7 Flash vs xAI: Grok 4.20