Methodology

How the per-election-district mayoral primary results on this site are constructed, and what they do and don't represent.

What this is

NYC election district (ED)-level results for the 2021 and 2025 Democratic mayoral primaries, including both first-choice tallies and ranked-choice voting (RCV) final-round tallies. The Board of Elections does not publish either of these at the ED level for citywide ranked-choice races; both are computed here from the official Cast Vote Record (CVR) files.

Sources

DataSourceFormat
2021 Democratic primary CVRvote.nycZip of XLSX, 109 MB
2025 Democratic primary CVRvote.nycZip of XLSX, 90 MB
Election district boundariesNYC Open Data h2n3-98hq via DCP ArcGIS RESTGeoJSON, 4,247 EDs
Candidate ID → name mapIncluded in each year's CVR ZIPXLSX

How results are computed

1. CVR parsing

Each CVR ZIP contains 25–32 XLSX files, one per borough × ballot-channel (election day, absentee, affidavit, early voting, emergency). Each row is one ballot; columns include the ballot's precinct (formatted AD: NN ED: NNN) and one column per (race, choice rank), e.g. DEM Mayor Choice 1 of 5 Citywide. Cell values are either a candidacy ID (integer), undervote, overvote, or Write-in.

For each year we extract precinct + the five DEM Mayor choice columns from every file, drop ballots with no DEM Mayor vote in any of the 5 ranks, and parse the precinct string into a single integer ED ID matching the shapefile field ElectDist (= AD × 1000 + ED).

2. First choice

For each ED, count ballots by their Choice 1 candidate (excluding undervotes, overvotes, and write-ins, which BOE reports separately). Percentages on the map are share of first-choice votes cast in that ED for a named DEM candidate, not share of all ballots.

3. RCV final round

This site uses the standard citywide-elimination approach — the same approach BOE uses to certify the official final-round tallies. The procedure is:

  1. Restrict the candidate set to "major" candidates — those who received at least 1% of citywide first-choice votes. For 2025 the majors are Mamdani, Cuomo, Lander, Adrienne Adams, and Stringer; for 2021 they are Adams, Garcia, Wiley, Yang, Stringer, Donovan, McGuire, and Morales.
  2. Run a single citywide instant-runoff elimination on all ballots: repeatedly eliminate the candidate with the fewest active votes citywide, redistributing those ballots to the next non-eliminated choice, until one candidate has a majority or only two remain (the "finalists").
  3. For each ED, count how each ballot would have been allocated at the final round — i.e. each ballot is counted toward the highest-ranked finalist on that ballot. The map's "RCV final" view shows that share per ED.

The 2021 finalists are Eric Adams and Kathryn Garcia. The 2025 finalists are Zohran Mamdani and Andrew Cuomo. In the "RCV final" view, eliminated candidates show 0% in every ED — they did not survive to the final round. To see geographic strength of an eliminated candidate, use the "First choice" view.

4. Geographic join

Each ED's results are joined to the 2024–2025 vintage of the NYC ED shapefile by integer ED ID. Both 2021 and 2025 elections were conducted under the post-2010-Census ED boundaries; while individual EDs occasionally split or merge between primaries, the great majority remain identical. EDs in the shapefile with no ballots in the CVR (typically retired or empty EDs) are dropped; ballots with an ED ID not present in the shapefile (typically formatting anomalies in the CVR) are also dropped — both counts are logged in the build pipeline.

What this is not

Reproducibility

All code, raw inputs, and normalized intermediates are in github.com/joshgreenman1973/nyc-election-archive. The pipeline is four scripts in data-pipeline/:

Last updated: 2026-04-25.