head-to-head
Anthropic: Claude Sonnet 5 vs xAI: Grok 4.20
Side-by-side comparison of specs, pricing, benchmark scores, and task rankings. Updated 2026-07-01.
| Anthropic: Claude Sonnet 5 | xAI: Grok 4.20 | |
|---|---|---|
| Vendor | anthropic | x-ai |
| Quality Score | 100 | 100 |
| Benchmark Score | - | 61.5 |
| Input Price | $2.00/M | $1.25/M |
| Output Price | $10.00/M | $2.50/M |
| Context Window | 1,000,000 | 2,000,000 |
| Max Output | 128,000 | - |
| Tool Calling | ✓ | ✓ |
| Structured Output | ✓ | ✓ |
| Reasoning Mode | ✓ | ✓ |
| Vision | ✓ | ✓ |
| Audio | - | - |
| Benchmark Scores | ||
| ai_index | - | 61.0 |
| eqbench | - | 55.8 |
Who wins by task?
| Task | Anthropic: Claude Sonnet 5 | xAI: Grok 4.20 |
|---|---|---|
| SQL Generation | 132 | 144 |
| Code Review | 132 | 150 |
| Code Completion | 117 | 122 |
| Code Refactoring | 136 | 153 |
| Bug Fixing | 136 | 154 |
| Unit Test Generation | 124 | 135 |
| Code Documentation | 129 | 141 |
| Regex Writing | 117 | 127 |
| CI/CD Pipelines | 120 | 131 |
| Frontend Component Design | 122 | 131 |
| Data Analysis | 124 | 136 |
| CSV / Spreadsheet Cleanup | 132 | 139 |
| ETL Scripting | 128 | 142 |
| JSON Extraction | 121 | 123 |
| Bulk Data Labeling | 118 | 120 |
| OCR / Document Parsing | 131 | 135 |
| Table Extraction from PDFs | 131 | 135 |
| Long-Document Summarization | 136 | 154 |
| Short-Form Summarization | 113 | 119 |
| Blog Post Writing | 120 | 132 |
Scores reflect capability match + benchmark data + pricing for each task. Methodology →
Related comparisons
Anthropic: Claude Sonnet 5 vs MoonshotAI: Kimi K2.7 Code
Anthropic: Claude Sonnet 5 vs Qwen: Qwen3.7 Plus
Anthropic: Claude Sonnet 5 vs MiniMax: MiniMax M3
Anthropic: Claude Sonnet 5 vs StepFun: Step 3.7 Flash
Anthropic: Claude Sonnet 5 vs xAI: Grok Build 0.1
Anthropic: Claude Sonnet 5 vs Google: Gemini 3.5 Flash
Anthropic: Claude Sonnet 5 vs Google: Gemini 3.1 Flash Lite
Anthropic: Claude Sonnet 5 vs xAI: Grok 4.3