head-to-head
Google: Gemma 4 31B vs SpaceXAI: Grok 4.20
Side-by-side comparison of specs, pricing, benchmark scores, and task rankings. Updated 2026-09-23.
| Google: Gemma 4 31B | SpaceXAI: Grok 4.20 | |
|---|---|---|
| Vendor | x-ai | |
| Quality Score | 100 | 100 |
| Benchmark Score | 53.7 | 50.6 |
| Input Price | $0.09/M | $1.25/M |
| Output Price | $0.34/M | $2.50/M |
| Context Window | 262,144 | 2,000,000 |
| Max Output | 16,384 | 1,800,000 |
| Tool Calling | ✓ | ✓ |
| Structured Output | ✓ | ✓ |
| Reasoning Mode | ✓ | ✓ |
| Vision | ✓ | ✓ |
| Audio | - | - |
| Benchmark Scores | ||
| ai_index | 31.3 | 42.3 |
| eqbench | 70.8 | 55.8 |
Who wins by task?
| Task | Google: Gemma 4 31B | SpaceXAI: Grok 4.20 |
|---|---|---|
| SQL Generation | 139 | 142 |
| Code Review | 140 | 146 |
| Code Completion | 131 | 121 |
| Code Refactoring | 141 | 150 |
| Bug Fixing | 144 | 150 |
| Unit Test Generation | 130 | 133 |
| Code Documentation | 134 | 139 |
| Regex Writing | 125 | 125 |
| CI/CD Pipelines | 126 | 129 |
| Frontend Component Design | 128 | 129 |
| Data Analysis | 132 | 133 |
| CSV / Spreadsheet Cleanup | 133 | 138 |
| ETL Scripting | 133 | 139 |
| JSON Extraction | 131 | 123 |
| Bulk Data Labeling | 129 | 120 |
| OCR / Document Parsing | 131 | 134 |
| Table Extraction from PDFs | 131 | 134 |
| Long-Document Summarization | 143 | 151 |
| Short-Form Summarization | 126 | 118 |
| Blog Post Writing | 127 | 130 |
Scores reflect capability match + benchmark data + pricing for each task. Methodology →
Related comparisons
Anthropic: Claude Haiku Latest vs Google: Gemma 4 31B
Anthropic: Claude Haiku Latest vs SpaceXAI: Grok 4.20
Anthropic: Claude Sonnet 5 vs Google: Gemma 4 31B
Anthropic: Claude Sonnet 5 vs SpaceXAI: Grok 4.20
Anthropic: Claude Sonnet Latest vs Google: Gemma 4 31B
Anthropic: Claude Sonnet Latest vs SpaceXAI: Grok 4.20
Google: Gemini 3.1 Flash Lite vs Google: Gemma 4 31B
Google: Gemini 3.1 Flash Lite vs SpaceXAI: Grok 4.20