BOSTON — The state’s winner-take-all election system means the top candidate in a crowded race could squeak out a win with only a small margin of ballots cast.

It happened in the Sept. 4 Democratic primary for the 3rd Congressional District. In a packed field of 10 candidates, Lori Trahan won with about 22 percent of the vote.

A coalition of progressive activists and good government groups wants the state to radically change how it chooses leaders.

They want to switch to a ranked-choice system that allows voters to weigh candidates in order of preference and transfer their votes if no one gets more than 50 percent.

Backers say ranked-choice voting ensures that winning candidates have broad support.

"It gives the voters more choices," said Jim Henderson, a board member and treasurer of Voter Choice Massachusetts, the group behind the effort. "It allows them to express their preference for the strongest candidate."

Henderson said the coalition is lobbying lawmakers to approve a switch for federal, state and local elections. If legislators don't take it up -- which they've been reluctant to do -- the coalition plans to put the question to voters in 2020, he said.

So how does ranked-choice voting work?

Instead of choosing just one candidate, voters rank all candidates in each race according to their preference, from first to last.

If a candidate wins 50 percent or more of the first-preference votes, they are declared the winner. However, if no candidate receives at least 50 percent of the vote, the candidate with the least votes is eliminated and the ballots are re-counted.

On that count, if voter’s first choice was the eliminated candidate, their second choice candidate would receive their vote.

This so-called "instant runoff" process is repeated until someone gets more than 50 percent of the vote.

Secretary of State Bill Galvin, who oversees the state's elections, likes the concept but wants to see how it goes in Maine – which is so far the only state to adopt it – before throwing his full support behind it for Massachusetts.

The city of Cambridge has used ranked-choice voting since the 1940s to elect its City Council and School Committee.

"It's a much fairer way of deciding elections," said Nadeem Mazen, a former Cambridge councilor and member of the coalition's advisory board. "We've seen so many races across the country where someone wins with 9 or 15 percent of the vote. That means you really don't know who the most popular candidate is, only who got the most votes."

Mazen said ranked-choice voting also prevents an independent or minor party candidate from playing "spoiler" to a major-party candidate.

"Whether it's a Democratic or Republican candidate, you see people undercutting each other in a way that doesn't always describe the true intention of the voters," he said.

Critics, however, say ranked-choice is confusing and leads to sleepy campaigns where the candidates avoid hot-button topics because they don’t want to alienate potential supporters.

While some other U.S. cities like San Francisco and Santa Fe, New Mexico, use ranked choice voting, Maine is the only state to adopt make the switch broadly.

The state's voters approved the change in a 2016 referendum, but it wasn’t implemented until this year because of multiple legal challenges.

So far, the system has only been used in a congressional race, the outcome of which prompted lawsuits when incumbent Republican U.S. Rep. Bruce Poliquin was unseated in the second round of vote-counting because the eventual winner had picked up second-choice rankings.

In Maine, the idea gained support, in part, because nine of the past 11 governors races had resulted in winners who failed to get a majority of the vote.

Republican Gov. Paul LePage, for example, was first elected 2010 with 38.1 percent of votes in a five-way race.

Other states are toying with the idea of moving away from winner-take-all elections. Last year, lawmakers in at least 14 states introduced bills on ranked choice voting, according to the National Conference of State Legislatures.

Christian M. Wade covers the Massachusetts Statehouse for The Salem News and its sister newspapers and websites. Email him at cwade@cnhi.com