head-to-head
Google: Gemma 4 31B vs xAI: Grok 4.20
Side-by-side comparison of specs, pricing, benchmark scores, and task rankings. Updated 2026-04-30.
| Google: Gemma 4 31B | xAI: Grok 4.20 | |
|---|---|---|
| Vendor | x-ai | |
| Quality Score | 100 | 100 |
| Input Price | $0.13/M | $2.00/M |
| Output Price | $0.38/M | $6.00/M |
| Context Window | 262,144 | 2,000,000 |
| Max Output | 16,384 | - |
| Tool Calling | ✓ | ✓ |
| Structured Output | ✓ | ✓ |
| Reasoning Mode | ✓ | ✓ |
| Vision | ✓ | ✓ |
| Audio | - | - |
Who wins by task?
| Task | Google: Gemma 4 31B | xAI: Grok 4.20 |
|---|---|---|
| SQL Generation | 131 | 133 |
| Code Review | 126 | 132 |
| Code Completion | 129 | 118 |
| Code Refactoring | 127 | 136 |
| Bug Fixing | 130 | 136 |
| Unit Test Generation | 121 | 124 |
| Code Documentation | 126 | 130 |
| Regex Writing | 119 | 118 |
| CI/CD Pipelines | 117 | 120 |
| CSV / Spreadsheet Cleanup | 128 | 133 |
| ETL Scripting | 122 | 128 |
| JSON Extraction | 131 | 122 |
| Bulk Data Labeling | 129 | 119 |
| OCR / Document Parsing | 128 | 131 |
| Table Extraction from PDFs | 128 | 131 |
| Long-Document Summarization | 129 | 137 |
| Short-Form Summarization | 123 | 114 |
| Blog Post Writing | 119 | 121 |
Scores reflect capability match + benchmark data + pricing for each task. Methodology →
Related comparisons
NVIDIA: Nemotron 3 Nano Omni (free) vs Google: Gemma 4 31B
NVIDIA: Nemotron 3 Nano Omni (free) vs xAI: Grok 4.20
Anthropic Claude Haiku Latest vs Google: Gemma 4 31B
Anthropic Claude Haiku Latest vs xAI: Grok 4.20
OpenAI GPT Mini Latest vs Google: Gemma 4 31B
OpenAI GPT Mini Latest vs xAI: Grok 4.20
Google Gemini Pro Latest vs Google: Gemma 4 31B
Google Gemini Pro Latest vs xAI: Grok 4.20