Skip to main content
Updated
LLMs for coding write, debug, and refactor code - distinct from the tools like Claude Code or Cursor that wrap them. Choosing one means trading capability against price and how much you can run yourself. We ranked 15 on blind web-dev preference and agentic benchmarks.

Best LLMs for Coding

#ModelBest for
Score is a normalized average of Code Arena’s WebDev Overall and the Artificial Analysis Coding Index; higher is better. Price is blended API cost per 1M tokens at a 3:1 input-to-output ratio.

How to Choose

When choosing between these models, consider:
  • Access: First decide whether you’ll use the model in an app, call it through an API, or run it locally. That choice drives cost, privacy, latency, and setup work more than small score differences do. For proprietary models, local isn’t an option; only Gemma 4 31B and Qwen3.5 27B are realistic self-run picks, and both need a high-memory machine.
  • Quality: Our score is a normalized average of Code Arena’s WebDev Overall (blind human preference on web-app output) and the Artificial Analysis Coding Index (Terminal-Bench and SciCode, usually at high reasoning effort). Treat it as a comparison spine across models, not universal coding truth - a model can top it and still lose on your specific stack.
  • Price: We use blended API cost per 1M tokens at a 3:1 input-to-output ratio for the cleanest comparison. App subscriptions and self-hosting change the real math, so read this as a relative yardstick.
  • Context Window: This is the maximum input a model accepts, not a promise it stays sharp across the whole window. Long-session reliability varies, so a bigger number helps but doesn’t guarantee coherence on giant repos.
One thing worth clearing up: the model is not the tool. Claude Code, Codex, Cursor, and Copilot are harnesses that run these models, and the same model can feel different depending on the harness around it. This list ranks the models themselves, not the coding tools that wrap them.

Other Models We Considered


Frequently Asked Questions

Claude Fable 5 and GPT-5.6 Sol are the two strongest, sitting together at the top of our score. Fable 5 has the highest ceiling on hard, long-horizon work; Sol matches it while using fewer tokens, which makes it cheaper to run at scale. For most people, though, Claude Sonnet 5 is the smarter default - most of that quality at a fraction of the cost.
Claude Sonnet 5. It lands close to the frontier on everyday coding, runs faster and cheaper than the top models, and is reliable enough to standardize on. Step up to Opus 4.8 or Fable 5 only when a task is genuinely hard.
At the very top they’re close: Fable 5 and GPT-5.6 Sol trade the lead depending on the task, so it’s more house style than a clear winner. Sol is notably token-efficient; Fable 5 has a slight edge on the hardest problems. Below them, Sonnet 5 and Opus 4.8 are strong Claude value picks, while GPT-5.6 Terra sits mid-pack.
GLM-5.2. It’s the highest-scoring open-weight model here and beats every other open option on coding, at near-budget pricing. Just know that “open weight” doesn’t mean “runs on your laptop” - it’s too large for that, so in practice you’ll call it through a host.
Gemma 4 31B, with Qwen3.5 27B as the other option. Both run offline, but only on a high-end, high-memory machine after quantization, and both drop a lot of quality versus the cloud models. They’re good for private, low-stakes coding and learning - not serious agent work.
The model is the underlying intelligence; the tool is the harness that feeds it your files, runs commands, and applies edits. Claude Code and Codex are harnesses that run Claude and GPT models. The same model can feel different across harnesses, which is why we rank the models here, not the tools.
Roughly, at the top. Our score blends blind human preference on web apps with agentic coding tests, which tracks real quality better than any single number. But it’s a comparison spine, not a guarantee - a model can top the table and still stumble on your language, framework, or codebase. Trust the ranking to narrow the field, then test your top two on your own work.