Best LLM for coding

Looking for the best LLM for coding? These rankings compare models on writing new code, fixing bugs and working across large codebases.

#1 for CodingAnthropic

Claude Fable 5.1

Claude Fable 5.1 has the highest Artificial Analysis Coding Index of the models we track — an independent test of writing and fixing real code.

See the full breakdown

What "best at coding" actually means

Our coding ranking is based on the Artificial Analysis Coding Index, an independent benchmark that tests models on writing and fixing real code — not on self-reported vendor numbers. The scores in the table above come from that benchmark and are re-published every week.

A high coding score means the model more often produces code that runs, handles edge cases, and follows the instructions it was given. It does not guarantee the model knows your specific framework or internal codebase, which is why we recommend a short hands-on test before you commit (see the guide below).

Real tasks where the top coding models differ

In day-to-day development work, the gap between the top-ranked models and the rest shows up most clearly on tasks like these:

  • Debugging a real stack trace: pasting an error message plus the failing function and asking for the cause and a fix. Stronger models identify the actual bug instead of rewriting unrelated code.
  • Writing a feature from a spec: for example, "add pagination to this API endpoint with cursor-based tokens." Top models produce complete, compiling code with fewer follow-up prompts.
  • Refactoring without breaking behavior: renaming, splitting, or modernizing a module while keeping its public interface identical. Weaker models quietly change behavior.
  • Explaining unfamiliar code: summarizing what a legacy function does and where its risks are. Better models cite the specific lines that matter.
  • Multi-file changes: edits that span several files, such as adding a field end-to-end from database schema to UI. This is where context window size (shown in the table) starts to matter as much as raw score.

How to choose a coding model: a 15-minute test

Benchmarks narrow the field; a quick self-test picks the winner for your work. Here is the process we recommend:

  • Pick 3–5 real tasks from your own recent work — one bug fix, one new feature, one refactor. Use tasks where you already know the right answer.
  • Run each task through the top 2–3 models from the ranking above, using the same prompt for each.
  • Score the answers yourself: does the code run? Did it follow the constraints? How much did you have to correct?
  • Check the price columns: if two models tie on quality, the cheaper one wins. Input price matters most if you paste large files; output price matters most if the model writes long files.
  • Check the context window: if you work in large repositories or paste whole files, prefer a model whose context window comfortably fits your typical input.

Common questions

Is the #1 model always the best choice? No. The ranking measures coding ability; it does not account for your budget, latency needs, or whether you must self-host. If you need open weights, filter by the Open/Closed column or see our open-source ranking.

How often does this ranking change? We re-publish every week. A model's position moves when new benchmark results are released or when a new model launches — see the weekly rankings archive for the history.

Why do some models have no coding score? We only show scores from benchmarks we can verify. If a model has no independent coding result, we leave the cell blank rather than guess.

See the weekly rankings archive for how these positions have moved, or read our methodology.