Live model · Ranked-choice voting

How Ranked-Choice Voting Actually Works

Ranked-choice voting, or instant runoff, lets you rank candidates in order. The count goes in rounds. If no one has more than half of the ballots still counting, the last-place candidate is out, and each of their ballots moves to its next choice still in. That repeats until someone has a majority.

Instant runoff, one round at a time

100 ballots rank 4 candidates: Ana, Ben, Cal and Dee. Each ballot counts for one candidate at a time, its highest choice still in the race.
StopInstant runoff
Voters per ballot
Round0Ballots100

First choices

Ballots

VotersRankingCounts for
38Ana > Cal > BenAna
27Ben > Cal > AnaBen
15Cal > Ben > AnaCal
7Cal > Ana > BenCal
9Dee > Ben > CalDee
4DeeDee

Watch the Python behind this model run, line by line

How to read the stage

The table lists 100 ballots in six groups: 38 voters ranked Ana, then Cal, then Ben, and so on. The bars count each ballot for its top choice still in the race, and the dashed line marks a majority of the ballots still counting. Ana leads round 1 with 38. Dee goes out, then Cal, and their ballots move on. Ben wins round 3, 51 to 45.

Why the majority line moves

Four voters ranked only Dee. Once Dee is out, those ballots rank no one left in the race, so they're exhausted and stop counting. The line moves with them: from more than half of 100 ballots to more than half of 96, which is 49. Maine's law also exhausts a ballot that skips two rankings in a row. Try Everyone bullet-votes Dee under Break it.

Same ballots, three winners

Count only first choices and Ana wins. The runoff picks Ben. But head to head, Cal beats every rival: 58 voters rank Cal over Ana, and 60 rank Cal over Ben. Cal has the fewest first choices of the three, so the runoff drops Cal in round 2, before those preferences count. That's the center squeeze. Alaska's 2022 special House election did the same to Nick Begich.

The same ballots, every pair head to head

The same 100 ballots, now as 6 two-candidate races. In each, a ballot votes for whichever of the two it ranks higher.
StopHead to head
Voters per ballot

Head to head: row's votes over column's

····AnaBenCalDeeAnaBenCalDee

Ballots

VotersRankingFirst choice
38Ana > Cal > BenAna
27Ben > Cal > AnaBen
15Cal > Ben > AnaCal
7Cal > Ana > BenCal
9Dee > Ben > CalDee
4DeeDee

What the model leaves out

Real counts handle what this one skips: overvotes, where a ballot puts two candidates in one place; skipped rankings; write-ins; and the lot drawn to break a tie for last, which the model replaces with the later-listed candidate. Some places drop several trailing candidates at once when none of them could catch up, which doesn't change the winner. The model also counts a single race.

Questions

Does ranking more candidates hurt my first choice?
No. Your ballot counts for your first choice for as long as that candidate is in the race. It only moves to your second choice once your first choice is out, so a lower ranking never counts against a higher one.
What happens if I rank only one candidate?
Your ballot counts for that candidate until they're out. Then it's exhausted and stops counting, like the four Dee-only ballots on the stage. Ranking more candidates keeps your ballot in later rounds, but you never have to.
Does the most-preferred candidate always win?
Not always. A candidate a majority prefers to each rival, the Condorcet winner, can trail on first choices and go out early, as Cal does above. It's uncommon in real elections, but in Alaska's August 2022 special election, an analysis of the ballots found Nick Begich would have beaten both finalists one on one.
Where is ranked-choice voting used?
Maine uses it for primaries and federal elections, Alaska for its general elections since 2022, and New York City for its primaries since 2021. Alaskans vote on November 3, 2026 on an initiative to repeal it, after a 2024 repeal failed by about two-tenths of a percentage point.
How is this different from a top-two runoff?
A top-two runoff keeps the two leaders and holds a second election weeks later. Instant runoff drops one candidate at a time, using the rankings already on the ballot, so there's no second trip to the polls, and a candidate in third can still climb past second as ballots move.

Drill the mechanism

Each round is a tally: a counter keyed by candidate, filled one ballot group at a time, then read for its smallest count. Top K Frequent Elements builds the same counter and reads its largest counts, and Valid Anagram compares two counters letter by letter.

More of how it works