A grid of red and blue precincts is partitioned into electoral districts by a live boundary-redrawing algorithm. Set the "Gerrymander bias" slider away from zero and watch the algorithm pack opposing voters into a few lopsided districts and crack the rest into many thin majorities — turning the same vote totals into wildly different seat counts.
Packing concentrates a party's supporters into few districts they win by huge, wasted margins. Cracking splits them into many districts as a minority. Both tactics convert vote share into disproportionate seat share without changing a single vote — the mechanism this simulator makes visible in real time.
Choose the number of districts, then drag "Gerrymander bias" left or right to favor Blue or Red. The boundary-redrawing algorithm runs continuously, animating district shapes as it optimizes. Click "New Map" for a fresh precinct layout, or "Reset Boundaries" to return to a compact, fair starting map.
The term "gerrymander" dates to 1812, coined after Massachusetts Governor Elbridge Gerry signed a district shaped like a salamander. Modern redistricting software can generate thousands of legal maps per second, making algorithmic packing and cracking far more precise than 19th-century pen-and-ink drawing.
This simulation models partisan gerrymandering: the manipulation of electoral district boundaries to advantage one political party. A 14×9 grid of precincts, each leaning red or blue by a randomly generated but geographically clustered margin, is partitioned into a configurable number of districts by a continuously running boundary-optimization algorithm. When the "Gerrymander bias" slider is nonzero, the algorithm favors moves that increase the target party's seat count — packing opposing voters into a small number of districts they win overwhelmingly, and cracking them thinly across many districts where they fall just short of a majority. At zero bias, the same algorithm instead optimizes purely for compact, contiguous shapes, producing a fair map.
The efficiency gap, popularized in a widely cited 2015 paper by law professors Nicholas Stephanopoulos and Eric McGhee, quantifies gerrymandering by comparing "wasted votes" — votes beyond what a winner needed, plus all votes for a loser — between parties. Courts in several U.S. states have cited efficiency-gap analysis in redistricting litigation, and the concept remains central to ongoing debates about partisan and racial gerrymandering, independent redistricting commissions, and algorithmic map-drawing reform.
Gerrymandering is the deliberate drawing of electoral district boundaries to give one political party or group an unfair advantage in elections. It works by manipulating how voters are distributed across districts without changing how anyone votes — the same total votes can produce very different numbers of seats depending on where the lines are drawn.
Pick the number of districts with the "Districts" slider, then move "Gerrymander bias" away from zero to favor Red or Blue. Watch the boundary lines redraw themselves in real time as the algorithm packs and cracks precincts. Compare the "Popular vote" and "Seats won" bars on the right to see the disproportion the map creates.
Packing crams a large share of the opposing party's voters into a small number of districts, so they win those districts by huge, wasted margins but control few seats overall. Cracking spreads the opposing party's voters thinly across many districts so they form a persistent minority in each one, winning zero of those seats despite substantial total support.
For each district, "wasted votes" are counted for both parties: all votes cast for the losing party, plus any votes the winning party received beyond the minimum needed to win (roughly half the district's votes plus one). The efficiency gap is the difference between the two parties' total wasted votes, divided by the total votes cast, expressed as a percentage. A large efficiency gap indicates one party's votes are being wasted far more than the other's — a signature of packing and cracking.
Legislative seats are awarded per district, not by statewide popular vote, so the geographic arrangement of voters into districts determines outcomes as much as raw vote totals do. A party can win a majority of total votes across all districts yet win a minority of seats if its supporters are inefficiently distributed — concentrated in a few districts (packed) or spread as consistent minorities (cracked) in many others.
The word combines "Gerry," after Massachusetts Governor Elbridge Gerry, and "salamander," describing the shape of an 1812 state senate district he signed into law that critics said resembled the amphibian. The term has since become the standard label for any manipulated electoral map, regardless of which party benefits.
Rules vary widely. Racial gerrymandering that dilutes minority voting power is prohibited under the U.S. Voting Rights Act and constitutional case law. Partisan gerrymandering, however, was ruled a non-justiciable political question by the U.S. Supreme Court in Rucho v. Common Cause (2019), leaving state courts, state constitutions, and independent redistricting commissions as the primary remedies in many jurisdictions.
Several U.S. states, including California, Michigan, and Arizona, have transferred district-drawing authority from state legislatures to independent commissions designed to reduce partisan control. These commissions typically use explicit compactness and competitiveness criteria similar to the "bias = 0" fair-map setting in this simulation, aiming to minimize the packing and cracking that produces large efficiency gaps.
Advances in computing power let map-drawers generate and score thousands of potential district plans per second, testing each for partisan advantage down to the precinct level. This has made gerrymandering far more precise and durable across multiple election cycles than the manual, map-by-hand redistricting of past decades, which is one reason algorithmic and statistical detection tools like the efficiency gap have become important countermeasures.
Researchers use Markov chain Monte Carlo methods to generate large ensembles of valid district maps and compare a proposed map's partisan outcomes against that distribution, flagging statistical outliers as likely gerrymanders. Other active areas include multi-metric fairness scoring beyond the efficiency gap, automated compactness measurement, and open-source redistricting tools that let the public evaluate and propose alternative maps during official redistricting processes.