The Electoral College is an anachronism, and although eliminating it is not realistic, it can be reformed to lessen the likelihood of electing a president who loses the popular vote.

Again this year, there is a real chance the candidate who gets the most votes won’t be the next president. It is too late to do anything for this election, but it is time to begin focusing on what should be done for the future.

The only number that matters in a U.S. presidential election is 270. That is the number of electoral votes it takes to be elected. There are 538 electors and victory requires getting a majority in the Electoral College. If no candidate receives a majority, if Hillary Clinton and Donald Trump were to each get 269 votes this year, then the House of Representatives chooses the president, with each state getting one vote.

Each state has the number of electors equal to the sum of its senators and representatives. Additionally, the 23rd Amendment allocates three electors to the District of Columbia. The six states with the most electors are California (55), Texas (38), New York (29), Florida (29), Illinois (20), and Pennsylvania (20). The seven smallest states in population — Alaska, Delaware, Montana, North Dakota, South Dakota, Vermont and Wyoming — each have three electors.

The Electoral College emerged as the way of choosing the president late in the deliberations at the Constitutional Convention in 1787. Many different methods of selecting the president were debated, such as direct popular election, selection by the governors of the states, and election by Congress as in a parliamentary system. The Electoral College, once proposed, attracted widespread support at the Constitutional Convention.

In part, this reflected the distrust of majority rule on the part of the framers of the Constitution. They had the Senate chosen by state legislatures, Supreme Court justices and lower federal court judges selected by the president with Senate approval, and the president determined by the Electoral College. Also, small states strongly favored the Electoral College because it gave them much greater influence than they would have in direct election of the president. In fact, in theory today, states with only 22 percent of the country’s population can choose the president.

Each state determines its own method for choosing electors. Now all states select the electors based on who wins the popular vote. By in the 19th century, about half the states had their state legislatures choose the electors. The Electoral College does not actually meet. Rather, the electors in each state gather on the Monday after the second Tuesday in December and determine how the state will allocate its electoral votes. In principle, the electors are to vote in accord with the popular vote in their state. Occasionally, though, there has been an elector who fails to do so.

All states except Nebraska and Maine allocate electors on a winner-take-all basis. In other words, the candidate who wins the popular vote in a state gets all of the electoral votes from that state.

Effectively that means a vote for, say, Donald Trump in California or Hillary Clinton in Texas has absolutely no effect given the virtual certainty that Clinton will carry California and get all of its electoral votes, and Trump will do the same in Texas.

Nebraska and Maine allocate electoral votes by congressional district, with the elector for each congressional district voting for the candidate who got the majority of the votes there and the remaining electors chosen statewide. There is a much more proportional allocation of electoral votes in Nebraska and Maine than in states where it is winner-take-all.

Because of the allocation of votes in the Electoral College and winner-take-all, there is always a chance that a presidential candidate could win the popular vote but not get a majority in the Electoral College. This has happened four times in American history, in 1824, 1876, 1888 and 2000, when Al Gore won the majority of the popular vote but George W. Bush won in the Electoral College. The United States is the only country in the world that uses an Electoral College and the only country in the world where the candidate who loses the popular vote can be chosen president.

It is easy to imagine scenarios where either Clinton or Trump loses the popular vote but wins in the Electoral College. This should be regarded as unacceptable in a democracy, regardless of which political party triumphs.

The ideal solution would be to eliminate the Electoral College. But that would require a constitutional amendment and there is no way that three-fourths of the states would approve this; small states that benefit from the Electoral College are not going to vote to abolish it. Another, more realistic, possibility would be for Congress to pass a statute requiring that every state allocate its electoral votes proportionate to the popular vote in the state. If a candidate gets 55 percent of the popular vote, he or she should get 55 percent of the electoral vote, not the current 100 percent.

At the very least, that would mean every vote in every state would have meaning. It also would dramatically lessen the chance that any presidential candidate could be elected without winning the popular vote.

The problem is that people tend to forget about the Electoral College, especially between presidential elections and particularly after elections where it makes no difference. But the real possibility of a repeat of 2000 should be an impetus for reform, hopefully before the country again elects a president who lost the election.

Erwin Chemerinsky is dean of the UC Irvine School of Law.