Every four years the US president and vice president are selected using as system called the electoral college, involving a group of 538 people known as “electors”.
Each state has a specific number of electors based on their population, according to census data. California, for example, has a population of 39 million and so has 55 electors, while Connecticut, which has a tenth of that population, has seven electors.
When voters go to the polls to vote for the next president on November 8th, they are voting for the electors who pledge to cast their ballots in the electoral college.
The number of electors matches the number of representatives (435) and senators (100) the states have in the US Congress. The District of Columbia’s three electors brings the figure to 538. The candidate who receives a majority of electorate votes (270) wins.
Forty eight states operate a winner-takes-all system: the candidate who wins the most public votes wins all the state's electors. Maine and Nebraska operates a system of proportional representation where the candidate who wins the most public votes in the states wins two electoral votes and the remaining votes are assigned by congressional district so it is possible for both candidates to win electors in Maine and Nebraska.
If no one wins the 270 majority of electoral votes - for example, if the outcome is 269 votes to 269 votes - the election is decided by the US House of Representatives. The three highest-polling candidates stand for election and each state votes. The winner is the candidate who wins the majority of the states. The US senate votes for the vice president.
If the House fails to elect a president by inauguration day (January 20th, 2017), the vice president serves as acting president until the deadlock is resolved.
It is possible to win the presidency by losing the public vote but winning the electoral college vote. This happened in 2000 when George W Bush lost the popular vote, by 50.4 million votes to Al Gore's 50.9 million votes, but won 271 electoral votes, carrying 30 states, to Gore's 266 electoral votes, winning 20 states and the District of Columbia.
Most states consistently vote for one party. Republicans rely on Texas, while Democrats can count comfortably on California every four years.
The election is normally decided by about a dozen battleground states, including Iowa, Nevada, Virginia and Colorado, though Republican Donald Trump is targeting states such as Pennsylvania and Wisconsin that have traditionally swung Democratic.
The biggest "swing states" this year are likely to be Ohio, North Carolina and Florida, which, with its 29 electoral votes, famously determined the outcome of the 2000 election.