The AI code generation statistics quoted most are the ones measured least. Google says 75% of its new code is AI-generated and engineer-approved. The best randomized trial of 2025 says AI made experienced developers 19% slower while they believed it made them faster, and the 2026 follow-up could not produce a clean number either way. Veracode's 2026 testing puts the security pass rate of AI-written code at 56%, unchanged in a year. These are the AI coding statistics that survive sourcing: how much code is written by AI, how fast, how safely, and by whom, each dated and linked to the page it came from.
Key AI code generation statistics for 2026
- 75% of new code at Google is AI-generated and approved by engineers, up from 50% in fall 2025 (Google, Cloud Next, April 2026).
- 20% to 30% of code in Microsoft repos is "probably all written by software" (Satya Nadella, April 2025, hedged).
- 29% of Python functions in the US are AI-written, lifting quarterly code output by 3.6% (Science, January 2026).
- 55.8% faster on a greenfield task with Copilot (randomized trial, 2023); 19% slower for experienced maintainers on their own repos (METR, 2025).
- 18% less time for returning developers, with a confidence interval from 38% less to 9% more, in METR's 2026 follow-up (57 developers, 800+ tasks), which calls the data "very weak evidence" (February 2026).
- 56% average security pass rate for AI-generated code across 100+ models, virtually unchanged from 2025 (Veracode, July 2026).
- +81% code block duplication and -70% refactoring moves since 2023 across 623 million changes (GitClear, 2026).
- 50 million GitHub Copilot users and one in three GitHub pull requests involving an agent (Microsoft, July 2026).
- 73% of respondents who use AI coding assistants or agents use them daily; 16% trust AI with most tasks that are not important work decisions (Stack Overflow 2026, n = 30,903).
- $2.5 billion Claude Code run-rate revenue (Anthropic, February 2026); $2 billion Cursor recurring revenue (Bloomberg, March 2026).
- 19% employment gap for 22 to 25 year olds in AI-exposed occupations, with no comparable gap for experienced workers (Stanford, ADP data through June 2026).
What percentage of code is written by AI?
At Google, 75% of new code is AI-generated and approved by engineers as of April 2026, up from 50% in fall 2025 and more than 25% in late 2024. Nadella puts Microsoft at "maybe 20%, 30%" with explicit hedging. Across the US as a whole, a peer-reviewed estimate puts AI at 29% of Python functions. There is no standard definition of "AI-written," so the percentage of code written by AI differs by ruler as much as by company.
The verbatim record from Big Tech
- Google: "Today, more than a quarter of all new code at Google is generated by AI, then reviewed and accepted by engineers" (Sundar Pichai, Q3 2024 earnings). By Cloud Next, April 2026: "Today, 75% of all new code at Google is now AI-generated and approved by engineers, up from 50% last fall." The metric is approved output, not autonomous commits.
- Microsoft: "I'd say maybe 20%, 30% of the code that is inside of our repos today and some of our projects are probably all written by software," Satya Nadella at LlamaCon, April 29, 2025. Note the triple hedge: maybe, probably, some.
- Coinbase: roughly "40% of daily code written at Coinbase is AI-generated. I want to get it to over 50% by October" (Brian Armstrong on X, September 2025). Robinhood: around 50% of new code, a figure the CEO calls imprecise because agentic editors blur authorship (July 2025).
- Frontier labs: Anthropic put its company-wide share at 70% to 90% in January 2026; the head of Claude Code says 100% of his own code. Meta and Amazon have published no comparable figure.
Startups, the whole economy, and seniority
- Y Combinator W25: for a quarter of the batch, 95% of the codebase was AI-generated, per YC's Jared Friedman.
- Economy-wide: a Science paper (published online January 22, 2026) estimates that AI writes 29% of Python functions committed by US developers, "a shrinking lead" over other countries, raising quarterly code output by 3.6%. It is the only population-level answer to how much code is written by AI, and it matches our AI statistics hub.
- Seniority flips the stereotype: 32% of senior developers say more than half the code they ship is AI-generated, about 2.5x the junior rate of 13% (Fastly, 791 developers, July 2025).
What counts as "AI-written"?
Google counts AI-generated lines an engineer approved. Nadella's figure was an on-stage estimate. YC's 95% counts code typed and excludes imports. The Science estimate classifies function style, not provenance. "100% of my code" describes one engineer's workflow. Any percentage of code written by AI is only as comparable as its ruler.
Does AI make developers faster or slower?
Both, depending on the setting, and these are the most misquoted AI code generation statistics of all. On a greenfield task Copilot made recruited developers 55.8% faster. On experienced maintainers' own codebases AI made them 19% slower while they believed they were 20% faster.
The controlled trials
- 55.8% faster: in the GitHub, Microsoft Research and MIT randomized trial (2023), recruited developers building a standalone JavaScript HTTP server with Copilot "completed the task 55.8% faster than the control group."
- 19% slower: METR's 2025 randomized trial gave 16 experienced open-source maintainers 246 real issues on their own repos: "when developers use AI tools, they take 19% longer than without." They had forecast a 24% speedup and afterwards still believed AI had sped them up by 20%.
- The 2026 follow-up: with 57 developers, 143 repos and 800+ tasks, METR estimates that returning developers took 18% less time with AI (confidence interval 38% less to 9% more, so possibly slower) and new recruits 4% less (15% less to 9% more). The authors "believe it is likely that developers are more sped up from AI tools now" but call the data "only very weak evidence for the size of this increase," because developers increasingly declined to participate rather than work without AI.
Field data and surveys
- Uplevel compared nearly 800 developers with and without Copilot access: "no significant change in efficiency metrics," while "the group using Copilot introduced 41% more bugs." Observational, so weaker than the trials.
- DORA 2024 tied a 25% rise in AI adoption to 7.2% lower delivery stability and 1.5% lower throughput. DORA 2025, from nearly 5,000 technology professionals, reframed it: "AI doesn't fix a team; it amplifies what's already there." More than 80% believe AI increased their productivity, yet 30% report little or no trust in AI-generated code.
- Fastly: 28% of developers frequently fix AI-generated code enough to offset most of the time savings; only 14% rarely need to make changes.
Greenfield, self-contained tasks are where AI shines; deep changes in codebases the developer knows intimately are where it still loses time. The AI coding statistics on speed should never be quoted without their setting.
Is AI-generated code secure and maintainable?
Not by default, and security is not improving with model size. Veracode's July 2026 report puts the security pass rate of AI-generated code at 56% across more than 100 models, "virtually unchanged since last year's report." Apiiro measured a 10x spike in security findings inside Fortune 50 repos. These are the AI code generation statistics that matter once the code is merged.
Security
- Veracode 2026 (July 2026; 11 new models across 80 tasks): models hit a syntax pass rate of about 100% but "fail nearly 44 percent of the time when given no security-specific guidance." GPT-5.5 leads at 68%; Java scores only 30%; coding-specialized models (51%) do no better than general-purpose ones (52%). The 2025 edition had found risky flaws in 45% of tests.
- Apiiro (Fortune 50 repos, several thousand developers): by June 2025 AI-generated code was introducing over 10,000 new security findings per month, a 10x spike in six months, with privilege escalation paths up 322% and design flaws up 153%.
- Stanford, Perry et al.: participants with an AI assistant "wrote significantly less secure code than those without access" and "were more likely to believe they wrote secure code." The overconfidence effect, measured.
Technical debt
The AI code generation statistics on maintainability come from GitClear's 2026 study of 623 million changes from 2023 to 2026, which reports "a 74% drop in long-term legacy updates and a 70% collapse in refactoring moves since 2023," with code block duplication up 81% (40.3 to 73.0 per million changed lines, a record). Moved code fell from 21% of changed lines in 2022 to 3.8% year-to-date in 2026, while copy/paste rose from 9.4% to 15.7%. The data is correlational with AI adoption, not per-commit attribution, but the trend bends where the assistants arrived.
How many developers use AI coding tools in 2026?
Nearly all of them. GitHub Copilot has 50 million users, Stack Overflow finds 73% of respondents who use AI coding assistants or agents using them daily, and two tools each passed $2 billion in annualized revenue in 2026. The adoption side of the AI code generation statistics is the one part nobody disputes.
- GitHub Copilot: 50 million users (Microsoft FY26 Q4 earnings call, July 2026), on a GitHub of 225 million users, and "one in three pull requests on GitHub now involves an agent." The count is users, not paid seats. Octoverse 2025: 80% of new developers use Copilot in their first week.
- Cursor: crossed $1 billion in annualized revenue in November 2025, reached $2 billion by March 2026 per a Bloomberg headline on its press page, and became a SpaceX subsidiary when the merger closed on August 14, 2026. Claude Code: over $2.5 billion in run-rate revenue as of February 2026, more than doubled since the start of the year. The $1 billion and $2.5 billion are company disclosures; the $2 billion is Bloomberg's.
- Surveys: Stack Overflow 2026 (30,903 valid responses, fielded June 23 to August 5, 2026): 73% of those who use AI coding assistants or agents use them daily, 31% of daily users spend over four hours a day with them, and Claude Code (66%) and GitHub Copilot (59%) lead among coding agents. JetBrains 2025: 85% regularly use AI tools for coding.
- AI code review grew from under 1% of pull requests in 2022 to about 1 in 7 by 2025 (Pullflow), while 72% of respondents said vibe coding is not part of their work (Stack Overflow 2025). The AI coding statistics on adoption and on trust point in opposite directions, and both are right.
Is AI replacing junior developers?
The cleanest data is payroll, not job postings, and it says entry-level hiring slowed while experienced employment did not. How much code is written by AI matters less here than who reviews it. Stanford's "Canaries in the Coal Mine?" study of ADP payroll data, revised August 12, 2026 with data through June 2026, finds that "employment of young workers (ages 22-25) in AI-exposed occupations now stands 19% below where it would be had it kept pace with that of their less-exposed peers; experienced workers show no comparable gap." The authors' headline is "No Widespread Displacement," and the exposed occupations include software developers.
Methodology: editions, years and definitions
Every figure in these AI code generation statistics is dated and linked to the page where it appears. Where a source has a newer edition the newer one leads: Veracode, GitClear, Stack Overflow and Stanford all have 2026 editions over 2025, METR's February 2026 update sits beside the 2025 trial, and Microsoft's July 2026 count of 50 million Copilot users supersedes July 2025's 20 million, although GitHub counted the earlier figure as all-time users and the newer one is undefined, so they may not be the same count. "AI-written" has no standard definition, so the percentage of code written by AI is quoted in each company's own words and never averaged. Octoverse 2026 and DORA 2026 were not published as of October 22, 2026. Figures shared with our AI statistics hub match that page.
The practical reading of these AI code generation statistics is not "use less AI." It is that the teams keeping the speed pair AI output with hard review, test and security gates the tools do not yet supply. That is the discipline behind our QA and code review services: the 56% pass rate is the model's number, and the gate is where it stops being yours.