{
  "id": "ranked-choice-voting",
  "version": "d65ac682dd4f",
  "status": "published",
  "name": "Ranked Choice Voting Calculator",
  "question": "Who wins by ranked choice voting?",
  "summary": "Counts ranked ballots by instant runoff: removes the last-place candidate round by round and moves those ballots to their next choice until someone has a majority.",
  "category": "statistics",
  "subcategory": "descriptive",
  "url": "https://www.acalculator.org/statistics/ranked-choice-voting-calculator",
  "markdown": "https://www.acalculator.org/statistics/ranked-choice-voting-calculator.md",
  "kind": "function",
  "method": "Each round: each ballot counts for its highest-ranked candidate still in the count; more than half of the continuing ballots wins; otherwise the candidate with the fewest votes is removed (all candidates with 0 votes together) and the count repeats.",
  "assumptions": [
    "Single-winner instant runoff with one last-place candidate removed per round, as in Maine law.",
    "A tie for last place with votes gives no answer: the law decides it (in Maine, by lot).",
    "Names match without regard to case or extra spaces; a ballot cannot rank one name twice."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "ballots": {
        "title": "Ballots",
        "description": "One row per ballot ranking, with how many voters cast it.",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "v": {
              "title": "Voters",
              "description": "How many voters cast this ranking.",
              "type": "integer",
              "minimum": 1,
              "maximum": 1000000000
            },
            "r": {
              "title": "Ranking",
              "description": "Candidates in order of preference, separated by > or commas.",
              "type": "string",
              "maxLength": 200
            }
          }
        }
      }
    }
  },
  "outputs": {
    "winner": {
      "label": "Winner",
      "description": "The candidate with more than half of the continuing ballots.",
      "format": "text"
    },
    "rounds": {
      "label": "Rounds",
      "description": "How many rounds of counting it took.",
      "format": "integer"
    },
    "winnerVotes": {
      "label": "Winner’s votes in the last round",
      "description": "Ballots counting for the winner in the final round.",
      "format": "integer"
    },
    "share": {
      "label": "Winner’s share of continuing ballots",
      "description": "Winner’s final votes ÷ continuing ballots in the final round.",
      "format": "percent"
    },
    "exhausted": {
      "label": "Exhausted ballots",
      "description": "Ballots that rank no candidate still in the count by the final round.",
      "format": "integer"
    },
    "total": {
      "label": "Ballots cast",
      "description": "All voters, added up over the rows.",
      "format": "integer"
    },
    "steps": {
      "label": "Round by round",
      "description": "Each round’s count and who was removed.",
      "format": "text"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "ballots": [
        {
          "votes": 40,
          "ranking": "Ana > Ben > Cy"
        },
        {
          "votes": 35,
          "ranking": "Ben > Cy > Ana"
        },
        {
          "votes": 25,
          "ranking": "Cy > Ben > Ana"
        }
      ]
    },
    "outputs": {
      "winner": "Ben",
      "rounds": 2,
      "winnerVotes": 60,
      "share": 60,
      "exhausted": 0,
      "total": 100,
      "steps": "Round 1: Ana 40, Ben 35, Cy 25 of 100 continuing; no majority, Cy removed; Round 2: Ben 60, Ana 40 of 100 continuing; Ben has a majority and wins"
    },
    "text": "Ben wins after 2 round(s), with 60% of the continuing ballots."
  },
  "examples": [
    {
      "given": {
        "ballots": [
          {
            "votes": 40,
            "ranking": "Ana > Ben > Cy"
          },
          {
            "votes": 35,
            "ranking": "Ben > Cy > Ana"
          },
          {
            "votes": 25,
            "ranking": "Cy > Ben > Ana"
          }
        ]
      },
      "expect": {
        "winner": "Ben",
        "rounds": 2,
        "winnerVotes": 60,
        "share": 60,
        "exhausted": 0,
        "total": 100
      },
      "source": "FairVote, How RCV works (more than half wins; otherwise the last-place candidate is removed and those votes go to the next choice); hand count in content.mdx; https://fairvote.org/our-reforms/ranked-choice-voting-information/"
    },
    {
      "given": {
        "ballots": [
          {
            "votes": 45,
            "ranking": "A"
          },
          {
            "votes": 35,
            "ranking": "B"
          },
          {
            "votes": 12,
            "ranking": "C > B"
          },
          {
            "votes": 6,
            "ranking": "C > A"
          },
          {
            "votes": 2,
            "ranking": "C"
          }
        ]
      },
      "expect": {
        "winner": "A",
        "rounds": 2,
        "winnerVotes": 51,
        "share": 52.04081632653061,
        "exhausted": 2
      },
      "source": "Maine Revised Statutes, Title 21-A, §723-A (exhausted ballots are left out of later rounds); hand count in content.mdx: 51 of 98 continuing; https://legislature.maine.gov/statutes/21-A/title21-Asec723-A.html"
    },
    {
      "given": {
        "ballots": [
          {
            "votes": 60,
            "ranking": "X > Y"
          },
          {
            "votes": 40,
            "ranking": "Y > Z"
          }
        ]
      },
      "expect": {
        "winner": "X",
        "rounds": 1,
        "share": 60
      },
      "source": "FairVote, How RCV works (a candidate with more than half of the first choices wins); hand count; https://fairvote.org/our-reforms/ranked-choice-voting-information/"
    }
  ],
  "sources": [
    "FairVote. Ranked Choice Voting Information: how RCV works (single winner: more than half wins, otherwise the last-place candidate is removed and those ballots count for the next choice), retrieved 2026-10-18. https://fairvote.org/our-reforms/ranked-choice-voting-information/",
    "Maine Revised Statutes, Title 21-A, §723-A. Determination of the winner of a ranked-choice election (continuing and exhausted ballots, rounds, ties for last place decided by lot), retrieved 2026-10-18. https://legislature.maine.gov/statutes/21-A/title21-Asec723-A.html"
  ],
  "related": [
    "percentage",
    "probability",
    "weighted-average",
    "average"
  ],
  "changelog": []
}
