head-to-head
Google: Gemma 4 31B (free) vs Anthropic: Claude Sonnet 4.6
Side-by-side comparison of specs, pricing, benchmark scores, and task rankings. Updated 2026-09-23.
| Google: Gemma 4 31B (free) | Anthropic: Claude Sonnet 4.6 | |
|---|---|---|
| Vendor | anthropic | |
| Quality Score | 100 | 100 |
| Benchmark Score | 53.7 | 69.7 |
| Input Price | Free | $3.00/M |
| Output Price | Free | $15.00/M |
| Context Window | 262,144 | 1,000,000 |
| Max Output | 32,768 | 128,000 |
| Tool Calling | ✓ | ✓ |
| Structured Output | ✓ | ✓ |
| Reasoning Mode | ✓ | ✓ |
| Vision | ✓ | ✓ |
| Audio | - | - |
| Benchmark Scores | ||
| ai_index | 31.3 | 49.6 |
| aider_polyglot | - | 61.3 |
| eqbench | 70.8 | 80.0 |
Who wins by task?
| Task | Google: Gemma 4 31B (free) | Anthropic: Claude Sonnet 4.6 |
|---|---|---|
| SQL Generation | 140 | 154 |
| Code Review | 140 | 161 |
| Code Completion | 132 | 120 |
| Code Refactoring | 141 | 162 |
| Bug Fixing | 144 | 166 |
| Unit Test Generation | 130 | 144 |
| Code Documentation | 135 | 142 |
| Regex Writing | 126 | 129 |
| CI/CD Pipelines | 126 | 138 |
| Frontend Component Design | 128 | 137 |
| Data Analysis | 132 | 147 |
| CSV / Spreadsheet Cleanup | 134 | 145 |
| ETL Scripting | 133 | 150 |
| JSON Extraction | 132 | 125 |
| Bulk Data Labeling | 130 | 118 |
| OCR / Document Parsing | 131 | 140 |
| Table Extraction from PDFs | 131 | 140 |
| Long-Document Summarization | 143 | 161 |
| Short-Form Summarization | 127 | 118 |
| Blog Post Writing | 128 | 137 |
Scores reflect capability match + benchmark data + pricing for each task. Methodology →
Related comparisons
Anthropic: Claude Haiku Latest vs Google: Gemma 4 31B (free)
Anthropic: Claude Sonnet 5 vs Google: Gemma 4 31B (free)
Anthropic: Claude Sonnet Latest vs Anthropic: Claude Sonnet 4.6
Anthropic: Claude Sonnet Latest vs Google: Gemma 4 31B (free)
ByteDance Seed: Seed-2.0-Lite vs Anthropic: Claude Sonnet 4.6
Google: Gemini 3.1 Flash Lite Preview vs Anthropic: Claude Sonnet 4.6
Google: Gemini 3.1 Flash Lite vs Anthropic: Claude Sonnet 4.6
Google: Gemini 3.1 Flash Lite vs Google: Gemma 4 31B (free)