Two numbers keep showing up whenever people argue about Cursor vs Copilot. According to a DiffVibe analysis of the Stack Overflow 2025 Developer Survey, GitHub Copilot sat at about 67.9% in answers to one AI question, while Cursor sat near 17.9% in answers to a separate development-environments question. Dividing one figure by the other tells you nothing, because two different groups of people answered two different questions.
Stack Overflow’s newer 2026 data fixes part of that problem. It asks about coding agents and assistants in a single question with a single base, so a fair head-to-head becomes possible. It also asks which of those tools respondents want to use in the next six months, and the distance between the used answers and the want answers is where the interesting signal lives.
The Cursor vs GitHub Copilot market share debate usually stops at the used column. You will go one step further and build a small Python tool that computes used share, want share, retention, conquest and the gap between them, with honest uncertainty on every figure. If you already know how to put a margin of error on a single survey share, this project reuses that math and adds the part most comparisons skip: how the two tools move relative to what developers say they plan to do.
The finished project is a short standard-library Python script, ships with unit tests, and runs against synthetic demo data in under two seconds.
Don't miss new tech stories on Google
Add Shattered once in the Google app and our stories show up in your news suggestions.
Cursor vs Copilot Market Share: Why One Number Never Settles It #
The phrase market share means at least three different things in this fight. It can mean seats sold, revenue collected or the share of surveyed developers who say they use a tool. Survey shares are the easiest to get and the easiest to misread, because they describe respondents rather than customers. A developer who tried Cursor for a weekend and a developer who runs Copilot all day both count once in a used column.
Survey respondents also select themselves. People who answer a long developer survey skew toward the engaged, the online and the opinionated. That does not make the data useless. It means every share you compute is a statement about the people who answered, with a sampling error you can quantify and a selection effect you can only discuss.
The used column is a stock. It tells you how many respondents already have a tool in their toolbox. A stock favors whoever shipped first and bundled widest, which is why a product that lives inside the editor and the platform many developers already pay for starts with a large lead. The want column behaves more like a flow. It captures intent, so it can move before usage does.
Three questions turn those two columns into something you can act on:
- Used share: what fraction of respondents used each tool in the past year?
- Retention: among respondents who used a tool, what fraction still want it in the next six months?
- Conquest: among respondents who did not use a tool, what fraction want to start?
A tool can lead on used share while trailing on conquest. Another can look small today and pull in far more interest than its footprint suggests. Neither pattern shows up in a single percentage, and both matter if you are choosing seats for a team or sizing up a rival. The rest of this project exists to compute those three numbers correctly, on one shared base, with intervals that tell you when a gap is just noise.
Careful wording matters as much as careful math. A sentence such as Cursor leads Copilot in want growth overstates what a survey can show. A sentence such as respondents in this survey were more likely to say they want to start using Cursor than Copilot, among those who did not use either, says exactly what the data supports. Write the second kind, and your numbers will survive a skeptical reader.
One naming wrinkle belongs in your config from day one. A Cursor community announcement dated November 30, 2026 says Cursor is now the Grok Build desktop app, and the same post tells users to swap @Cursor for @Build in integrations from December 7. Survey answer labels are frozen at the time of fielding, so your alias list should accept both names and let you see which one your data actually contains.
Prerequisites and Versions #
You need very little. The project deliberately avoids third-party packages so that nothing breaks when a library ships a new major version.
- Python 3.11 or newer. The config uses
tomllib, which entered the standard library in 3.11. The test run shown below used Python 3.12.3. - A terminal and a text editor. Any shell works. On Windows, replace
python3withpyorpython. - About 70 minutes. Most of that goes to typing and reading output. The code itself runs in seconds.
- Optional real data. The respondent-level CSV from the Stack Overflow survey download page, or the published counts you can copy from the survey’s AI results page. The demo needs neither.
- No pip installs. The tool uses
csv,math,random,argparse,tomllibandunittestonly.
Keep one rule in mind before you start. The demo file is synthetic. Its numbers prove that the code works, and they say nothing about real developers. Whenever you see a percentage in a code block below, treat it as test output unless the text says otherwise.
If you want broader background on tools in this space, the coding and developer tools coverage collects the comparisons, pricing breakdowns and setup guides in one place.
What the Stack Overflow Survey Measures for Each Tool #
Stack Overflow’s own summary of the 2026 AI data reduces the pair to one sentence: “In the 2026 Stack Overflow Developer Survey, 58.7% of respondents reported using GitHub Copilot, compared with 25.5% who reported using Cursor.” You can read the underlying tables on Stack Overflow’s 2026 AI data page, which offers a used view and a want-to-use view for the same coding agent question.
Two details make that comparison safe, and two details made the older 2025 comparison unsafe. In 2026 both tools appear in one multi-select question, so every respondent had the same chance to tick either box and the denominator is shared. In 2025, according to the DiffVibe analysis cited above, the figures came from separate questions with very different respondent counts, so each percentage described a different slice of the survey.
The survey asks whether respondents used each coding agent or assistant in the past year, and whether they want to use each one in the next six months. Both answers are multi-select, which means one respondent can appear under many tools. Percentages therefore add up to far more than 100%, and that is normal.
| Question style | Who answers | Denominator | What the percentage means | Safe to compare across tools? |
|---|---|---|---|---|
| Single multi-select question, used in the past year | Everyone who saw the question | One shared base | Share of respondents who used the tool | Yes |
| Single multi-select question, want in the next six months | Everyone who saw the question | One shared base | Share of respondents who plan to use the tool | Yes |
| Separate questions per tool category | Different subsets of respondents | A different base per tool | Share within that subset only | No |
| Seat counts or revenue from a vendor | Paying customers | Not a survey base | Commercial footprint | Different measure entirely |
The table explains why the project refuses to compare tools with different bases. If you want to see what the raw respondent file looks like before you trust any share, the walkthrough on how to load the survey file with pandas shows the column layout and the usual cleaning steps. The approach here uses plain Python, but the survey structure is the same.
Surveys cannot replace commercial data either. A broader market share audit combines survey shares with seat exports and public signals, because each source has a blind spot the others cover. Treat this project as the survey leg of that triangle.
Step 1: Lay Out the Project #
Create the directory tree first. Keeping the package, tests, data and output folders separate makes the commands in later steps copy-and-paste safe.
mkdir -p demand-gap/dg demand-gap/tests demand-gap/data demand-gap/out
cd demand-gap
touch dg/__init__.py
python3 --version
Make sure your Python is recent enough before you continue. If it is too old, install a newer interpreter, since tomllib will not import on older versions.
Here is what each file does, so you can build a mental map before you type any code:
dg/stats.pyholds the Wilson interval, a ratio interval and a percentile helper.dg/load.pyreads respondent-level CSV files and published count files.dg/metrics.pyturns respondent patterns into used, want, retention and conquest, then bootstraps them.dg/report.pyprints the tables and writes a CSV.dg/demo.pygenerates synthetic respondents with known behavior.dg/cli.pyanddg/__main__.pywire everything intopython3 -m dg.config.tomlnames the columns and the tool aliases.tests/test_stats.pylocks the math in place.
Run every later command from the demand-gap folder. The package imports as dg, so launching Python from another directory is the most common reason for an import error. The troubleshooting section covers that case.
Steps 2 and 3: Wilson Intervals and Unit Tests #
Step 2 is the statistics module. Every share in the report gets an interval, so this file sits underneath everything else.
The Wilson score interval handles small counts and extreme shares much better than the textbook normal approximation. When a tool has a 1% share or a 99% share, the normal interval can slip below zero or above one. Wilson stays inside the valid range and has better coverage at modest sample sizes. For a plain proportion, it is the right default.
Interval width follows the base size, so it helps to hold a rough scale in your head. For a share near 50%, the 95% half-width is about 3.1 points when the base is 1,000 respondents and about 1 point when the base is 10,000. Quadrupling the sample only halves the width. That square-root relationship is why small segments in a survey produce intervals too wide to say anything.
The module also includes a Katz log-ratio interval for the want-to-used ratio in counts mode, plus a percentile function for the bootstrap. Create dg/stats.py:
from math import exp, sqrt
Z95 = 1.959963984540054
def wilson(k, n, z=Z95):
if n <= 0 or not 0 <= k <= n:
raise ValueError(f"bad counts k={k} n={n}")
p = k / n
denom = 1 + z * z / n
centre = (p + z * z / (2 * n)) / denom
half = z * sqrt(p * (1 - p) / n + z * z / (4 * n * n)) / denom
return max(0.0, centre - half), min(1.0, centre + half)
def katz_ratio(k1, n1, k2, n2, z=Z95):
if min(k1, k2) <= 0:
raise ValueError("zero count: ratio interval is undefined")
ratio = (k1 / n1) / (k2 / n2)
se = sqrt(1 / k1 - 1 / n1 + 1 / k2 - 1 / n2)
return ratio, ratio * exp(-z * se), ratio * exp(z * se)
def percentile(sorted_values, q):
if not sorted_values:
raise ValueError("empty sample")
pos = (len(sorted_values) - 1) * q
lo = int(pos)
hi = min(lo + 1, len(sorted_values) - 1)
return sorted_values[lo] + (sorted_values[hi] - sorted_values[lo]) * (pos - lo)
The wilson function validates its inputs before doing any math. A count larger than the base, or a base of zero, raises ValueError immediately. That strictness catches swapped columns in a counts file before they turn into a nonsense interval.
Check the math with known values
Step 3 pins the behavior down with tests. Known Wilson values give you an external anchor. For 5 successes in 10 trials the 95% interval has a lower bound near 0.2366, and for 0 successes in 10 trials the upper bound lands near 0.2775. The tests also cover parsing, the retention calculation and the denominator guard you will build later. Create tests/test_stats.py:
import unittest
from dg.load import cell_index, split_multi
from dg.metrics import summarize
from dg.report import counts_report
from dg.stats import katz_ratio, wilson
class StatsTests(unittest.TestCase):
def test_wilson_known_values(self):
lo, hi = wilson(5, 10)
self.assertAlmostEqual(lo, 0.2366, places=3)
self.assertAlmostEqual(hi, 0.7634, places=3)
lo, hi = wilson(0, 10)
self.assertEqual(lo, 0.0)
self.assertAlmostEqual(hi, 0.2775, places=3)
def test_wilson_rejects_bad_counts(self):
with self.assertRaises(ValueError):
wilson(11, 10)
with self.assertRaises(ValueError):
wilson(1, 0)
def test_katz_ratio_centre(self):
ratio, lo, hi = katz_ratio(30, 100, 20, 100)
self.assertAlmostEqual(ratio, 1.5)
self.assertLess(lo, ratio)
self.assertGreater(hi, ratio)
def test_split_multi(self):
self.assertEqual(split_multi("Cursor; GitHub Copilot"), {"cursor", "github copilot"})
self.assertIsNone(split_multi("NA"))
self.assertIsNone(split_multi(" "))
def test_summarize_retention(self):
cells = [0] * 16
cells[cell_index(1, 1, 0, 0)] = 80
cells[cell_index(1, 0, 0, 0)] = 20
cells[cell_index(0, 0, 0, 0)] = 100
est = summarize(cells, ("cursor", "copilot"))
self.assertAlmostEqual(est["cursor.used"], 0.5)
self.assertAlmostEqual(est["cursor.retention"], 0.8)
self.assertAlmostEqual(est["cursor.conquest"], 0.0)
def test_counts_guard_refuses_mixed_bases(self):
rows = [
{"tool": "a", "used": 10, "n_used": 100, "want": 5, "n_want": 100},
{"tool": "b", "used": 10, "n_used": 90, "want": 5, "n_want": 90},
]
with self.assertRaises(SystemExit):
counts_report(rows)
if __name__ == "__main__":
unittest.main()
Some of these tests import modules you have not written yet, so they cannot pass until Steps 4 through 8 exist. Write the test file now anyway, since a failing import tells you exactly which module is still missing. After you finish Step 8, run:
python3 -m unittest discover -s tests -v
A passing run looks like this:
test_counts_guard_refuses_mixed_bases (test_stats.StatsTests.test_counts_guard_refuses_mixed_bases) ... ok
test_katz_ratio_centre (test_stats.StatsTests.test_katz_ratio_centre) ... ok
test_split_multi (test_stats.StatsTests.test_split_multi) ... ok
test_summarize_retention (test_stats.StatsTests.test_summarize_retention) ... ok
test_wilson_known_values (test_stats.StatsTests.test_wilson_known_values) ... ok
test_wilson_rejects_bad_counts (test_stats.StatsTests.test_wilson_rejects_bad_counts) ... ok
----------------------------------------------------------------------
Ran 6 tests in 0.000s
OK
Six tests pass in a fraction of a second. If the Wilson values drift in the third decimal place, check that you copied the z constant exactly.
Steps 4 and 5: Load Multi-Select Answers Onto One Base #
Step 4 builds the . Survey multi-select answers arrive as one cell with options joined by a delimiter, so the splits each cell, lowercases the labels and compares them to the alias set for each tool.
Step 5 is about what counts as an answer, and it is where many survey analyses go wrong. An empty cell or the literal NA means the respondent skipped the question. A cell that says none of these means the respondent answered and picked nothing. Those two cases are different people. The treats the first as missing and the second as a real answer, then keeps only respondents who answered both the used and the want question. That choice gives every metric the same base.
Each kept respondent collapses into one of 16 patterns, built from four yes-or-no facts: used tool A, want tool A, used tool B, want tool B. The counts how many respondents fall into each pattern. Everything downstream, including the bootstrap, works on those 16 counts instead of on thousands of rows. Create dg/load.py:
import csv
def split_multi(cell, delimiter=";"):
if cell is None:
return None
cell = cell.strip()
if not cell or cell.upper() == "NA":
return None
return {part.strip().casefold() for part in cell.split(delimiter) if part.strip()}
def cell_index(used_a, want_a, used_b, want_b):
return (used_a << 3) | (want_a << 2) | (used_b << 1) | want_b
def read_microdata(path, used_col, want_col, aliases_a, aliases_b, delimiter=";"):
cells = [0] * 16
seen = {"rows": 0, "used_answered": 0, "want_answered": 0, "both": 0}
with open(path, newline="", encoding="utf-8-sig") as handle:
reader = csv.DictReader(handle)
for col in (used_col, want_col):
if col not in (reader.fieldnames or []):
raise SystemExit(f"column {col!r} not found; header has {reader.fieldnames}")
for row in reader:
seen["rows"] += 1
used = split_multi(row[used_col], delimiter)
want = split_multi(row[want_col], delimiter)
seen["used_answered"] += used is not None
seen["want_answered"] += want is not None
if used is None or want is None:
continue
seen["both"] += 1
cells[cell_index(
int(bool(used & aliases_a)), int(bool(want & aliases_a)),
int(bool(used & aliases_b)), int(bool(want & aliases_b)),
)] += 1
if seen["both"] == 0:
raise SystemExit("no respondent answered both questions; check column names")
return cells, seen
def read_counts(path):
rows = []
with open(path, newline="", encoding="utf-8-sig") as handle:
for row in csv.DictReader(handle):
rows.append({
"tool": row["tool"].strip(),
"used": int(row["used"]), "n_used": int(row["n_used"]),
"want": int(row["want"]), "n_want": int(row["n_want"]),
})
if len(rows) < 2:
raise SystemExit("counts file needs at least two tools")
return rows
Three design choices deserve a sentence each. The file opens with the utf-8-sig encoding, so a byte-order mark from a spreadsheet export never corrupts the first column name. The column check fails loudly and prints the actual header, which saves a long guessing session. And read_counts expects both a used base and a want base for every tool, because the guard in Step 11 compares them.
Compressing respondents into patterns also unlocks a question that raw shares hide. The same 16 counts tell you how much the two user bases overlap, which matters because a respondent who ticked both tools is not evidence that one beats the other.
Steps 6 and 7: Retention, Conquest and the Paired Bootstrap #
Step 6 turns the 16 counts into metrics. For each tool the function computes used share, want share, the gap between them, retention and conquest. It also computes one comparison, the difference between the two tools’ gaps.
| Metric | Formula | Question it answers |
|---|---|---|
| Used share | respondents who used the tool / shared base | How big is the footprint today? |
| Want share | respondents who want the tool / shared base | How much interest points at it? |
| Gap | want share minus used share | Is interest ahead of or behind the footprint? |
| Retention | used and want / used | Do current users plan to stay? |
| Conquest | want but did not use / did not use | Do outsiders want in? |
| Gap difference | gap of tool A minus gap of tool B | Which tool has more unrealized pull? |
Picture two hypothetical tools to see why the split matters. Tool A keeps 90% of its users and recruits 5% of everyone else. Tool B keeps 60% and recruits 25%. Both could show the same gap against their footprint, yet A is a defended incumbent and B is a leaky bucket under a strong tap. A buyer deciding between them, or a competitor studying them, would act differently on each story.
Retention and conquest decompose the gap. A tool with high retention and low conquest has loyal users and little outside appeal. A tool with moderate retention and high conquest is attracting curiosity but losing some of the people it already has. The gap alone cannot tell those stories apart.
Step 7 adds uncertainty. Retention and conquest are ratios of counts that come from the same respondents, so a simple formula for their interval would ignore the correlation between used and want answers. The bootstrap sidesteps that. It resamples respondents with replacement, recomputes every metric on each resample and reads the 2.5th and 97.5th percentiles. Create dg/metrics.py:
import random
from collections import Counter
from itertools import accumulate
from .stats import percentile
def summarize(cells, names):
n = sum(cells)
out = {}
for slot, name in enumerate(names):
used_bit, want_bit = (3, 2) if slot == 0 else (1, 0)
used = sum(c for i, c in enumerate(cells) if i >> used_bit & 1)
want = sum(c for i, c in enumerate(cells) if i >> want_bit & 1)
kept = sum(c for i, c in enumerate(cells) if i >> used_bit & 1 and i >> want_bit & 1)
won = want - kept
out[f"{name}.used"] = used / n
out[f"{name}.want"] = want / n
out[f"{name}.gap"] = (want - used) / n
out[f"{name}.retention"] = kept / used if used else float("nan")
out[f"{name}.conquest"] = won / (n - used) if n > used else float("nan")
a, b = names
out[f"gap_diff.{a}-{b}"] = out[f"{a}.gap"] - out[f"{b}.gap"]
return out
def bootstrap(cells, names, reps, seed):
rng = random.Random(seed)
n = sum(cells)
cum = list(accumulate(cells))
samples = {}
for _ in range(reps):
drawn = Counter(rng.choices(range(16), cum_weights=cum, k=n))
stats = summarize([drawn.get(i, 0) for i in range(16)], names)
for key, value in stats.items():
if value == value:
samples.setdefault(key, []).append(value)
return {
key: (percentile(sorted(vals), 0.025), percentile(sorted(vals), 0.975))
for key, vals in samples.items()
}
Why resample whole respondents
The resampling draws from the 16 patterns with probabilities proportional to their counts. Each draw represents one respondent, so a resample keeps each person’s answers together. If you resampled the used column and the want column separately, you would destroy the link between them and understate the uncertainty on retention and conquest. Paired resampling is the entire reason the intervals for the gap and the gap difference are trustworthy.
The bootstrap measures sampling error only. It cannot see who declined to answer or who never found the survey. The write-up on survey selection bias covers how to stress-test that second problem, and you should read the intervals here as a floor on your uncertainty.
Steps 8 and 9: Report and Command-Line Interface #
Step 8 writes the report. It prints the shared base size first, so you always know how many respondents survived the complete-case filter, then one row per metric with a Wilson interval where the metric is a plain share and a bootstrap interval for everything. It also draws a crude bar chart in the terminal and writes the same numbers to out/metrics.csv for spreadsheets.
The counts-mode report lives in the same file. It refuses to run when the denominators differ, which is the lesson from the 2025 numbers turned into code. Create dg/report.py:
import csv
from .stats import katz_ratio, wilson
PLAIN = ("used", "want")
def pct(x):
return "n/a" if x != x else f"{x * 100:.1f}%"
def interval(lo, hi):
return f"{pct(lo)} to {pct(hi)}"
def bar(x, width=30):
return "#" * round(max(0.0, min(1.0, x)) * width)
def micro_report(names, cells, boot, seen, out_csv):
from .metrics import summarize
n = sum(cells)
est = summarize(cells, names)
lines = [
f"respondents in file: {seen['rows']}",
f"answered used question: {seen['used_answered']}, want question: {seen['want_answered']}",
f"complete cases (shared base n): {n}, dropped: {seen['rows'] - n}",
"",
f"{'metric':<26}{'estimate':<10}{'wilson 95%':<20}{'bootstrap 95%':<20}",
]
out_rows = []
for key, value in est.items():
lo, hi = boot.get(key, (float("nan"), float("nan")))
metric = key.partition(".")[2]
wil = ""
if metric in PLAIN:
wil = interval(*wilson(round(value * n), n))
lines.append(f"{key:<26}{pct(value):<10}{wil:<20}{interval(lo, hi):<20}")
out_rows.append([key, f"{value:.5f}", f"{lo:.5f}", f"{hi:.5f}"])
lines.append("")
for name in names:
lines.append(
f"{name:<10} used |{bar(est[name + '.used']):<30}| want |{bar(est[name + '.want']):<30}|"
)
with open(out_csv, "w", newline="", encoding="utf-8") as handle:
writer = csv.writer(handle)
writer.writerow(["metric", "estimate", "boot_lo", "boot_hi"])
writer.writerows(out_rows)
return "\n".join(lines)
def counts_report(rows, allow_mismatch=False):
bases = {r["n_used"] for r in rows} | {r["n_want"] for r in rows}
if len(bases) > 1 and not allow_mismatch:
detail = "; ".join(f"{r['tool']} used n={r['n_used']}" for r in rows)
raise SystemExit(f"REFUSED: denominators differ ({detail}). Different questions, not one market.")
lines = [f"{'tool':<10}{'used':<8}{'wilson 95%':<19}{'want':<8}{'wilson 95%':<19}{'want/used':<11}ratio 95%"]
for r in rows:
ul, uh = wilson(r["used"], r["n_used"])
wl, wh = wilson(r["want"], r["n_want"])
ratio, rl, rh = katz_ratio(r["want"], r["n_want"], r["used"], r["n_used"])
lines.append(
f"{r['tool']:<10}{pct(r['used'] / r['n_used']):<8}{interval(ul, uh):<19}"
f"{pct(r['want'] / r['n_want']):<8}{interval(wl, wh):<19}"
f"{ratio:<11.2f}{rl:.2f} to {rh:.2f}"
)
return "\n".join(lines)
The CSV has four columns: the metric name, the estimate, and the lower and upper bootstrap bounds. Open it in any spreadsheet and sort by the metric name to group each tool’s numbers together. Keep the raw estimates at five decimal places in the file and round only when you display them, so later calculations never inherit rounding error.
Step 9 wires the commands together. Three subcommands cover the workflow: demo writes synthetic respondents, micro analyzes a respondent-level file and counts analyzes published tables. Create dg/cli.py:
import argparse
import tomllib
from pathlib import Path
from .demo import make_demo
from .load import read_counts, read_microdata
from .metrics import bootstrap, summarize
from .report import counts_report, micro_report
def run_micro(args):
cfg = tomllib.loads(Path(args.config).read_text(encoding="utf-8"))
names = list(cfg["tools"])
if len(names) != 2:
raise SystemExit("config must define exactly two [tools.*] tables")
aliases = [{a.casefold() for a in cfg["tools"][n]["aliases"]} for n in names]
survey = cfg["survey"]
cells, seen = read_microdata(
survey["path"], survey["used_col"], survey["want_col"],
aliases[0], aliases[1], survey.get("delimiter", ";"),
)
boot = bootstrap(cells, names, cfg["bootstrap"]["reps"], cfg["bootstrap"]["seed"])
Path(args.out).parent.mkdir(parents=True, exist_ok=True)
print(micro_report(names, cells, boot, seen, args.out))
def run_counts(args):
print(counts_report(read_counts(args.file), args.allow_mismatch))
def main(argv=None):
parser = argparse.ArgumentParser(prog="dg")
sub = parser.add_subparsers(dest="cmd", required=True)
demo = sub.add_parser("demo")
demo.add_argument("--out", default="data/demo_microdata.csv")
demo.add_argument("--rows", type=int, default=4000)
demo.add_argument("--seed", type=int, default=7)
micro = sub.add_parser("micro")
micro.add_argument("--config", default="config.toml")
micro.add_argument("--out", default="out/metrics.csv")
counts = sub.add_parser("counts")
counts.add_argument("--file", default="data/published_counts.csv")
counts.add_argument("--allow-mismatch", action="store_true")
args = parser.parse_args(argv)
if args.cmd == "demo":
make_demo(args.out, args.rows, args.seed)
print(f"wrote {args.rows} synthetic rows to {args.out}")
elif args.cmd == "micro":
run_micro(args)
else:
run_counts(args)
Then add the entry point that lets you call the package with python3 -m dg. Create dg/__main__.py:
from .cli import main
main()
Last, create the config. It names the two survey columns, the delimiter, the alias lists and the bootstrap settings. The alias list for Cursor includes Grok Build so that either label is counted if a future survey wave relabels the product. Create config.toml:
[survey]
path = "data/demo_microdata.csv"
used_col = "AIAgentsUsed"
want_col = "AIAgentsWant"
delimiter = ";"
[tools.cursor]
aliases = ["Cursor", "Grok Build"]
[tools.copilot]
aliases = ["GitHub Copilot", "Copilot"]
[bootstrap]
reps = 1000
seed = 20261203
The config requires exactly two tool tables. That limit comes from the 16-pattern encoding, and it keeps the comparison honest, because every metric answers a question about one specific pair.
Steps 10 and 11: Run the Demo and the Denominator Guard #
Step 10 generates data and runs the analysis. The demo generator draws 4,000 synthetic respondents with known behavior: a given probability of using each tool, a higher chance of wanting a tool you already use, and a 4% chance of skipping each question. It also adds five unrelated tools as noise, so the parser has real work to do. Create dg/demo.py:
import csv
import random
OTHERS = ["Claude Code", "OpenAI Codex", "Windsurf", "Aider", "Cline"]
def make_demo(path, rows, seed):
rng = random.Random(seed)
with open(path, "w", newline="", encoding="utf-8") as handle:
writer = csv.writer(handle)
writer.writerow(["ResponseId", "AIAgentsUsed", "AIAgentsWant"])
for rid in range(1, rows + 1):
used_p = rng.random() < 0.587
used_c = rng.random() < (0.38 if used_p else 0.12)
want_p = rng.random() < (0.62 if used_p else 0.20)
want_c = rng.random() < (0.80 if used_c else 0.12)
used, want = [], []
if used_p:
used.append("GitHub Copilot")
if used_c:
used.append("Cursor")
if want_p:
want.append("GitHub Copilot")
if want_c:
want.append("Cursor")
for tool in OTHERS:
if rng.random() < 0.10:
used.append(tool)
if rng.random() < 0.10:
want.append(tool)
skip_used = rng.random() < 0.04
skip_want = rng.random() < 0.04
writer.writerow([
rid,
"NA" if skip_used else ";".join(used) or "None of these",
"NA" if skip_want else ";".join(want) or "None of these",
])
Now run it. The first command writes the CSV and the second analyzes it:
python3 -m dg demo
python3 -m dg micro
You should see output close to this. The figures come from the synthetic demo data, so yours should look much the same:
wrote 4000 synthetic rows to data/demo_microdata.csv
respondents in file: 4000
answered used question: 3852, want question: 3837
complete cases (shared base n): 3695, dropped: 305
metric estimate wilson 95% bootstrap 95%
cursor.used 26.7% 25.3% to 28.1% 25.2% to 28.2%
cursor.want 29.1% 27.6% to 30.6% 27.7% to 30.5%
cursor.gap 2.4% 1.3% to 3.5%
cursor.retention 78.0% 75.5% to 80.5%
cursor.conquest 11.3% 10.1% to 12.5%
copilot.used 58.7% 57.1% to 60.3% 57.1% to 60.3%
copilot.want 44.5% 42.9% to 46.1% 42.8% to 46.1%
copilot.gap -14.2% -16.0% to -12.4%
copilot.retention 61.5% 59.4% to 63.5%
copilot.conquest 20.2% 18.3% to 22.2%
gap_diff.cursor-copilot 16.6% 14.6% to 18.7%
cursor used |######## | want |######### |
copilot used |################## | want |############# |
Read it from the top. The base line says 305 of 4,000 respondents were dropped because they skipped one of the two questions, and every metric uses the remaining 3,695. In this synthetic file Cursor’s want share runs 2.4 points above its used share, with an interval that excludes zero. Copilot’s want share runs 14.2 points below its used share. Those results follow directly from the probabilities written into the generator, which is exactly what you want from a test fixture.
Use the demo as a recovery test before you touch real data. Edit the probabilities in dg/demo.py, regenerate the file, and check that the report moves in the direction you expect. Raise the chance that Cursor users want Cursor again and retention should climb. Drop the chance that outsiders want Copilot and conquest should fall. If the tool fails to recover a change you made on purpose, you have found a bug before it can corrupt a real analysis.
Step 11 handles published tables. Sometimes you have no respondent file, only the counts printed on a results page. Counts mode takes a small CSV with a used count, a want count and a base for each tool. Create data/demo_counts.csv and a second file that reconstructs the mixed 2025 situation from the rounded percentages in the DiffVibe analysis. The want columns in that second file are placeholders, because the guard fires before they are read:
cat > data/demo_counts.csv <<'EOF'
tool,used,n_used,want,n_want
cursor,2550,10000,2840,10000
copilot,5870,10000,5240,10000
EOF
cat > data/mixed_bases_2025.csv <<'EOF'
tool,used,n_used,want,n_want
cursor,4680,26143,1,26143
copilot,5651,8323,1,8323
EOF
python3 -m dg counts --file data/demo_counts.csv
python3 -m dg counts --file data/mixed_bases_2025.csv
The first command prints a table. The second refuses, and that refusal is the feature:
tool used wilson 95% want wilson 95% want/used ratio 95%
cursor 25.5% 24.7% to 26.4% 28.4% 27.5% to 29.3% 1.11 1.06 to 1.17
copilot 58.7% 57.7% to 59.7% 52.4% 51.4% to 53.4% 0.89 0.87 to 0.92
REFUSED: denominators differ (cursor used n=26143; copilot used n=8323). Different questions, not one market.
exit code: 1
The ratio column divides the want share by the used share, and its interval treats the two counts as independent. That approximation is conservative here, since the same respondents answered both questions and the true paired interval is narrower. For a rigorous interval, use the respondent-level mode.
Step 12: Point the Tool at the Real Survey #
Step 12 swaps synthetic data for the real thing. Download the respondent-level CSV from Stack Overflow’s survey page, then open the header row and the accompanying schema file. Find the columns for the coding agent question, one for used and one for want. The exact column names change between survey waves, so copy them from the header instead of guessing.
Edit three lines in config.toml: the path, the used column and the want column. Check the delimiter too. Stack Overflow exports multi-select answers with semicolons between options, which matches the default, but a re-saved spreadsheet export may use something else. Then run python3 -m dg micro again.
Two checks before you trust the output. First, compare your used share for each tool with the published page. Your numbers should land within a few tenths of a point, and the gap usually comes from base differences, because the page may count respondents who answered the used question while your complete-case base requires both answers. Second, read the dropped count. If more than a fifth of respondents vanish, the want question probably went to a subset, and your shares describe that subset.
Record what you did while you do it. Save the CSV header, the survey wave, the download date and the exact config next to the output file. A comparison that nobody can reproduce carries little weight, and a note written at the time takes thirty seconds.
If you only have the published tables, use counts mode and copy the used and want counts and the base from the page. Matching on counts instead of percentages avoids rounding noise, and the Wilson intervals need counts anyway.
Survey files often ship with weights or come from a sample that over-represents some countries. The tool as written treats every respondent equally. If the file includes a weight column or you suspect the mix is skewed, the method in reweighting a survey by raking adjusts the pattern counts before the bootstrap, and you can feed the weighted counts into the same summarize function.
Reading the Output and What Changed Since the Survey #
Start with retention and conquest, then look at the gap. The gap is a summary, and the two components tell you whether a tool is holding its base, widening it or doing neither.
Any Cursor vs Copilot verdict should name which of the three numbers it rests on. Interpret intervals before you interpret point estimates. If the interval on the gap difference includes zero, the survey cannot tell you which tool has more unrealized pull. If it excludes zero by a wide margin, you still cannot say why. Want answers measure stated intent, and intent does not equal switching. Respondents who say they want a tool in six months will often never install it.
When you write up the result, state the base, the wave and the question in the same sentence as the number. For example, write that among respondents who answered both the used and the want question, the gap difference between the two tools was positive with an interval that excluded zero. That sentence tells a reader what was measured, who was measured and how sure you are. It leaves no room for a stronger claim to sneak in.
A survey also freezes a moment, and both products have kept moving. GitHub’s Copilot moved to usage-based billing on June 1, 2026, with one AI credit worth $0.01, and its model lineup grew through November. Cursor restructured its plans during 2026 as well. Compare the current official prices:
| Plan | Price per month | Notes |
|---|---|---|
| Copilot Free | $0 | Up to 2,000 monthly code suggestions and 50 monthly premium requests |
| Copilot Pro | $10 | Base price, with usage-based billing through monthly GitHub AI Credits |
| Copilot Pro+ | $39 | Base price under the same announcement |
| Copilot Business | $19 per seat | Per granted seat |
| Copilot Enterprise | $39 per seat | Per granted seat |
| Cursor Free | $0 | Listed on Cursor’s pricing page |
| Cursor Plus | $8 | Listed on Cursor’s pricing page |
| Cursor Premium | $30 | Listed on Cursor’s pricing page |
| Cursor Super | $100 | Listed on Cursor’s pricing page |
| Cursor Ultra | $200 | Listed on Cursor’s pricing page |
The credit mechanics are spelled out in GitHub’s Copilot billing documentation, and a dated log of Cursor plan changes records that the older Pro at $20 and Pro+ at $60 tiers were superseded during 2026. Neither fact enters your survey math. Both explain why a survey taken mid-year may not describe a December 2026 buyer.
The model menus changed too. In November 2026 GitHub added Claude Fable 5.2 on November 9, OpenAI’s GPT-6.2 Astra and GPT-6.2 Sol on November 17, Microsoft’s MAI Code 2 in the same release cycle, and Gemini 4 Neon on November 18. Cursor’s release notes list Grok 4.7 and Claude Opus 5.5 among its newer models, and Cursor announced its Agent SDK on October 20. A survey respondent who answered before those releases was describing an older product.
When your survey comparison disagrees with a second dataset, do not average them. Work out why they differ. The approach in decompose drift between survey numbers splits a gap into base, wording and population effects, and that split usually explains more than another chart would.
Common Pitfalls #
These six mistakes account for most wrong Cursor vs Copilot share claims, and the project guards against several of them directly.
- Comparing different denominators. A share among one group of respondents and a share among a different group of respondents are not parts of one market. The counts guard exists to stop exactly this.
- Treating skipped answers as zeros. A blank cell is not a respondent who uses nothing. If you code blanks as zero, every share shrinks and retention looks worse than it is.
- Reading want share as a forecast. Stated intent overstates action. Use the gap to rank interest, never to predict seat counts.
- Ignoring label drift. A product that gets renamed splits across labels. Cursor’s reported move to the Grok Build name is a live example, so keep an alias list and print the labels you actually see.
- Quoting a point estimate without its interval. A 2-point gap with an interval from minus 1 to plus 5 is no gap at all. Always print both ends.
- Mixing survey waves. A 2025 share and a 2026 share come from different samples and different question designs. Compare within a wave and describe changes between waves as a discussion, never as a trend line.
Double counting causes a quieter error. Because the answers are multi-select, a respondent who uses both tools appears in both used columns. Adding the two shares together and calling the total the market overstates it, and subtracting one from the other ignores the overlap. Report each share on its own and report the overlap separately.
A seventh trap hides in the word share. A respondent share is not a revenue share and not a seat share. A tool bundled into a platform subscription can show a high respondent share while producing little revenue of its own, and a premium tool can show the opposite. Label every chart with what it measures.
Troubleshooting #
Work through these in order when something fails. Each item names the symptom, the cause and the fix.
- ModuleNotFoundError: No module named ‘dg’. You launched Python from the wrong folder. Change into the
demand-gapdirectory and usepython3 -m dg, neverpython3 dg/cli.py. - ModuleNotFoundError: No module named ‘tomllib’. Your Python is too old. Install a newer version, or run the tool inside a newer virtual environment.
- column ‘AIAgentsUsed’ not found. The config column name does not match the file. The error prints the real header, so copy the correct names into
config.toml. - no respondent answered both questions. The two columns share no answered rows. Check that you picked the used and want columns for the same question, and confirm the delimiter.
- A tool shows 0.0% used. The alias list misses the label in your file. Print the labels with the snippet below and add every spelling you find.
- Retention prints n/a. No respondent in the shared base used that tool, so the ratio has a zero denominator. Check the alias list first, then the base.
- ValueError: bad counts k=… n=…. A count exceeds its base, usually because the used and base columns are swapped in a counts file. Fix the column order.
- REFUSED: denominators differ. The tools in your counts file come from different questions. Pull both counts from the same question, or accept that the comparison is invalid. The
--allow-mismatchflag exists for experiments only. - UnicodeDecodeError while reading the CSV. The file is not UTF-8. Re-export it as UTF-8 from your spreadsheet tool.
- The bootstrap takes too long. Lower
repsin the config while you iterate, then raise it for the final run. Runtime grows with respondents times resamples. - Your shares differ from the published page by a few tenths. The page and your complete-case base use different respondent sets. Compare counts, not rounded percentages, and read the dropped count.
To see which labels your file contains, run this one-off snippet. It prints the most common used labels, and it is how you spot a renamed product:
python3 - <<'EOF'
import csv, collections
counts = collections.Counter()
with open("data/demo_microdata.csv", newline="", encoding="utf-8-sig") as handle:
for row in csv.DictReader(handle):
for label in (row["AIAgentsUsed"] or "").split(";"):
counts[label.strip()] += 1
for label, n in counts.most_common(8):
print(f"{n:6d} {label}")
EOF
Run against the demo file, it prints something like this:
2258 GitHub Copilot
1026 Cursor
858 None of these
409 OpenAI Codex
391 Cline
370 Windsurf
365 Claude Code
357 Aider
Advanced Tips #
Once the basic run works, a few extensions raise the quality of the answers.
Cut by segment safely
Splitting by experience level, country or role is the obvious next step, and it is also the easiest way to fool yourself. Small segments produce wide intervals, and testing many segments guarantees that some gaps look significant by luck. Set a minimum base, such as 200 respondents, below which the tool prints no estimate. Report the number of segments you looked at next to any segment that stands out. A Cursor vs Copilot result that holds in every large segment deserves more trust than one that appears in a single small slice. Weighted cuts get more reliable when you combine them with the raking approach described earlier.
Cross-check against other evidence. Survey intent is one signal. Public activity is another. A public repository footprint measures what developers commit to open projects, which does not depend on who answers a survey. When the survey gap and the footprint point the same way, your confidence should rise. When they disagree, you have found a question worth investigating.
Automation helps too. Put the unit tests and a demo run in a scheduled job, and diff the new output against the previous run. A change in the demo numbers with no change in the code usually means a different Python build or an edited seed, and a change in your real-data numbers after a re-download means the survey file itself moved. Either way, you want to learn about it from a diff instead of from a reader.
Beyond those two ideas, keep these habits:
- Pin your data. Commit the exact CSV or counts file you analyzed, along with the seed and the config. Reproducibility matters most when someone challenges a number a month later.
- Log the date. Write the run date into every output file. The pricing and model facts around these tools changed repeatedly in 2026, so an undated chart ages badly.
- Show intervals in charts. Export
out/metrics.csvto a plotting tool and draw error bars, because bars without them invite overreading. - Extend the pair carefully. The 16-pattern encoding supports exactly two tools. To compare a third, run the tool twice with different pairs, and keep the shared base in mind, since each pair has its own complete cases.
- Test the guard. Add a unit test for any new check you write, the same way the denominator guard has one.
Frequently Asked Questions #
What is the market share of Cursor vs GitHub Copilot?
No single figure answers it. Survey shares measure the fraction of respondents who say they use a tool, seat counts measure paying customers, and revenue measures money. On Stack Overflow’s 2026 AI data page, 58.7% of respondents reported using GitHub Copilot and 25.5% reported using Cursor, and both numbers describe respondents in that survey only.
Why can’t I compare the 2025 Copilot and Cursor percentages directly?
They came from different questions with different respondent counts. A percentage from a question answered by a few thousand respondents and a percentage from a question answered by tens of thousands describe different slices of the survey, so dividing one by the other produces a number with no meaning.
What does the want-to-use column add?
It shows stated intent over the next six months. Compared with the used column, it reveals whether a tool is holding its users through retention and attracting outsiders through conquest. It does not predict installs.
Do I need pandas or NumPy?
No. The project uses only the Python standard library, which keeps it portable and avoids version conflicts. You can swap in pandas for if you prefer, as long as you produce the same 16 pattern counts.
Which Python version do I need?
Python 3.11 or newer, because the config relies on tomllib. The code in this tutorial was tested on Python 3.12.3.
What if the product name in my survey file differs from the current name?
Survey labels reflect the name at fielding time. The config accepts a list of aliases per tool, so add every spelling and print the labels in your own file to see which ones appear.
Can I use this for other tool pairs?
Yes, including a GitHub Copilot vs Cursor run with the order reversed, which only flips the sign of the gap difference. Change the two [tools.*] tables and their aliases, point the columns at any multi-select used and want questions, and the same metrics apply. The only structural limit is two tools per run.