Google: Gemma 4 31B (free) vs SpaceXAI: Grok 4.20
Side-by-side comparison of specs, pricing, benchmark scores, and task rankings. Updated 2026-11-07.
| Google: Gemma 4 31B (free) | SpaceXAI: Grok 4.20 | |
|---|---|---|
| Vendor | x-ai | |
| Quality Score | 100 | 100 |
| Benchmark Score | 53.7 | 56.5 |
| Input Price | Free | $1.25/M |
| Output Price | Free | $2.50/M |
| Context Window | 262,144 | 2,000,000 |
| Max Output | 32,768 | 1,800,000 |
| Tool Calling | ✓ | ✓ |
| Structured Output | ✓ | ✓ |
| Reasoning Mode | ✓ | ✓ |
| Vision | ✓ | ✓ |
| Audio | - | - |
| Benchmark Scores | ||
| ai_index | 48.4 | 61.0 |
| ai_index_agentic | 23.8 | - |
| ai_index_coding | 71.7 | - |
| eqbench | 57.5 | 45.7 |
The verdict
For a sample job of 1 million input tokens and 250,000 output tokens, Gemma 4 31B (free) costs $0 and Grok 4.20 costs $1.88, so Gemma 4 31B (free) is free for the same work.
Grok 4.20 reads up to 2,000,000 tokens at once, roughly 3,000 pages of text, against about 393 pages for Gemma 4 31B (free).
Only Gemma 4 31B (free) offers video input.
On our blended benchmark score Grok 4.20 leads 56.5 to 53.7.
Across the 20 tasks where they differ, Gemma 4 31B (free) scores higher on 17 (SQL Generation, Code Review, Code Completion and others), Grok 4.20 on 3 (Code Refactoring, Code Documentation, Long-Document Summarization).
Gemma 4 31B (free) was released in April 2026 and Grok 4.20 in March 2026.
Pick Gemma 4 31B (free) if you need lower cost, video input or the stronger all-round task scores; pick Grok 4.20 if you need long documents or benchmark performance.
Costs use current list prices per million tokens; page counts assume about 0.75 words per token and 500 words per page.
Who wins by task?
| Task | Google: Gemma 4 31B (free) | SpaceXAI: Grok 4.20 |
|---|---|---|
| SQL Generation | 156 | 144 |
| Code Review | 152 | 149 |
| Code Completion | 131 | 121 |
| Code Refactoring | 151 | 151 |
| Bug Fixing | 160 | 153 |
| Unit Test Generation | 143 | 134 |
| Code Documentation | 137 | 140 |
| Regex Writing | 131 | 127 |
| CI/CD Pipelines | 135 | 130 |
| Frontend Component Design | 138 | 131 |
| Data Analysis | 152 | 135 |
| CSV / Spreadsheet Cleanup | 145 | 138 |
| ETL Scripting | 143 | 141 |
| JSON Extraction | 143 | 123 |
| Bulk Data Labeling | 133 | 120 |
| OCR / Document Parsing | 140 | 135 |
| Table Extraction from PDFs | 140 | 135 |
| Long-Document Summarization | 149 | 153 |
| Short-Form Summarization | 129 | 119 |
| Blog Post Writing | 133 | 132 |
Scores reflect capability match + benchmark data + pricing for each task. Methodology →