head-to-head

Google: Gemma 4 31B vs Anthropic: Claude Sonnet 4.6

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

Google: Gemma 4 31B Anthropic: Claude Sonnet 4.6
Vendorgoogleanthropic
Quality Score100100
Benchmark Score-80.0
Input Price$0.12/M$3.00/M
Output Price$0.37/M$15.00/M
Context Window262,1441,000,000
Max Output16,384128,000
Tool Calling
Structured Output
Reasoning Mode
Vision
Audio--
Benchmark Scores
ai_index-85.3
ai_index_agentic-100.0
ai_index_coding-84.1
aider_polyglot-61.3

Who wins by task?

TaskGoogle: Gemma 4 31BAnthropic: Claude Sonnet 4.6
SQL Generation 131 181
Code Review 126 177
Code Completion 129 118
Code Refactoring 127 172
Bug Fixing 130 194
Unit Test Generation 121 163
Code Documentation 126 144
Regex Writing 119 139
CI/CD Pipelines 117 152
Frontend Component Design 122 153
Data Analysis 124 184
CSV / Spreadsheet Cleanup 128 158
ETL Scripting 122 162
JSON Extraction 131 141
Bulk Data Labeling 129 123
OCR / Document Parsing 128 150
Table Extraction from PDFs 128 150
Long-Document Summarization 129 166
Short-Form Summarization 123 123
Blog Post Writing 119 145

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

Related comparisons

Google: Gemini 3.1 Flash Lite vs Google: Gemma 4 31B Google: Gemini 3.1 Flash Lite vs Anthropic: Claude Sonnet 4.6 xAI: Grok 4.3 vs Google: Gemma 4 31B xAI: Grok 4.3 vs Anthropic: Claude Sonnet 4.6 Mistral: Mistral Medium 3.5 vs Google: Gemma 4 31B Mistral: Mistral Medium 3.5 vs Anthropic: Claude Sonnet 4.6 NVIDIA: Nemotron 3 Nano Omni (free) vs Google: Gemma 4 31B NVIDIA: Nemotron 3 Nano Omni (free) vs Anthropic: Claude Sonnet 4.6