Today’s US presidential election is a nightmare for the pollsters. On the one hand nearly every national poll puts Hillary Clinton ahead. Of some 20 or so final polls, all but two (one of which has long appeared to be an outlier) have put her in front. So anything other than a Clinton victory will be regarded as a polling failure.

But on the other hand, although there seems to have been a small swing in her favour in the final days, the Democrat nominee’s lead is still only a narrow one – on average between three and four points. Just four of the final polls give her a lead of more than four points.

That is not a lot more than the average error in presidential election polls during the last 50 years – two points. If the polls are overestimating her strength in this election by just a little more than that the outcome could be very close indeed.

Meanwhile, of course, it is not the nationwide vote that will decide who will become the next president. Rather, it will be who wins most votes in an electoral college in which big states have many more votes than small states and where, with just a couple of exceptions, the winner in a state takes all of its electoral college votes irrespective of the narrowness of their victory.

US Presidential election: key moments in pictures Show all 12 1 /12 US Presidential election: key moments in pictures US Presidential election: key moments in pictures The 2005 Access Hollywood video which showed Mr Trump bragging to Billy Bush NEW YORK, NY - JANUARY 20: Donald Trump (R) is interviewed by Billy Bush of Access Hollywood at "Celebrity Apprentice" Red Carpet Event at Trump Tower on January 20, 2015 in New York City. (Photo by Rob Kim/Getty Images) Getty US Presidential election: key moments in pictures Hillary Clinton and her health concerns NEW YORK, NY - SEPTEMBER 11: Democratic presidental nominee former Secretary of State Hillary Clinton arrives with an unidentified woman at the September 11 Commemoration Ceremony at the National September 11 Memorial & Museum on September 11, 2016 in New York City. Hillary Clinton left a September 11 Commemoration Ceremony early after feeling overheated and went to her daughter's house to rest. (Photo by Justin Sullivan/Getty Images) Getty US Presidential election: key moments in pictures Hillary Clinton and her health concerns Democratic presidential nominee Hillary Clinton gets in her van after leaving her daughter's apartment building after resting onSeptember 11, 2016 in New York, New York. Clinton departed from a remembrance ceremony on the 15th anniversary of the 9/11 attacks after feeling "overheated," but was later doing "much better," her campaign said. / AFP / Brendan Smialowski (Photo credit should read BRENDAN SMIALOWSKI/AFP/Getty Images) Getty US Presidential election: key moments in pictures Mr Trump suggests gun-supporters could kill Hillary Clinton to prevent her from picking the supreme court justices U.S. Republican presidential candidate Donald Trump attends the National Rifle Association's NRA-ILA Leadership Forum during their annual meeting in Louisville, Kentucky, U.S., May 20, 2016. REUTERS/Aaron P. Bernstein - RTSF81G Reuters US Presidential election: key moments in pictures Melania Trump plagiarises Michelle Obama’s speech Melania Trump, wife of presumptive Republican presidential candidate Donald Trump, addresses delegates on the first day of the Republican National Convention on July 18, 2016 at Quicken Loans Arena in Cleveland, Ohio. The Republican Party opened its national convention, kicking off a four-day political jamboree that will anoint billionaire Donald Trump as its presidential nominee. / AFP / Robyn BECK (Photo credit should read ROBYN BECK/AFP/Getty Images) Getty US Presidential election: key moments in pictures Mr Trump said that judge Gonzalo Curiel would not be able to rule fairly, as he was of Mexican heritage Gonzalo Curiel - Mexican judge Trump insulted United States Federal Court/AP US Presidential election: key moments in pictures Donald Trump anxious over securing black vote Republican U.S. presidential nominee Donald Trump looks back at supporters holding signs at a campaign rally in Lakeland, Florida, U.S., October 12, 2016. REUTERS/Mike Segar Reuters US Presidential election: key moments in pictures Hillary Clinton and concerns about securing black vote TOPSHOT - New American Makia Nunes kisses a cardboard cutout of Democratic presidential nominee Hillary Clinton as volunteers and supporters of Republican presidential nominee Donald Trump and Clinton were on hand outside the Los Angeles Convention Center, to greet and help recruit new voters following their Naturalization Ceremony on October 18, 2016 in Los Angeles, California. / AFP / Frederic J. BROWN (Photo credit should read FREDERIC J. BROWN/AFP/Getty Images) Getty US Presidential election: key moments in pictures Pope Francis Questions Donald Trump's Christianity Pope Francis leads a mass for the Jubilee of Inmates, on November 6, 2016 at St Peter's basilica in Vatican. One thousand prisoners -- including some lifers -- take part in a special event at the Vatican this weekend, along with 3,000 family members, prison staff and volunteers. The prisoners from 12 countries will had yesterday the opportunity to confess and walk through the "Holy Door" at Saint Peter's Basilica, a Jubilee tradition by which Catholics can ask forgiveness for their sins. / AFP / VINCENZO PINTO (Photo credit should read VINCENZO PINTO/AFP/Getty Images) Getty US Presidential election: key moments in pictures Donald Trump and his relentless remarks against Mexican people View of an "Alebrije" -Mexican folk art traditional sculptures representing fantastical creatures - with a figure representing US Republican presidential nominee Donald Trump during the tenth Monumental "Alebrijes" Parade and contest organized by the Folk Art Museum, on October 22, 2016 in Mexico City. More than two hundreds "Alebrijes" take part in the event. / AFP / YURI CORTEZ (Photo credit should read YURI CORTEZ/AFP/Getty Images) Getty US Presidential election: key moments in pictures Donald Trump and the sexual assault allegations LOS ANGELES, CA - OCTOBER 22: Attorney Gloria Allred holds a photo of jessica drake (R) with Donald Trump, taken in 2006 during an event where Drake alleges now-Republican presidential candidate Trump behaved in an sexually inappropriate way toward her, on October 22, 2016 in Los Angeles, California. This is the first news conference at which Drake has spoken to the public about her allegations against the candidate. Trump has been falling further behind Democratic presidential rival Hillary Clinton in the polls as women continue to come forth to accuse him of inappropriate sexual behavior. (Photo by David McNew/Getty Images) Getty US Presidential election: key moments in pictures FBI director announced that there would be no charges for Hillary Clinton amid email scandal US Democratic presidential nominee Hillary Clinton speaks during a campaign rally at the Pasco-Hernando State College in Dade City, Florida, on November 1, 2016. FBI agents are plumbing hundreds of thousands of emails in search of potentially incriminating evidence against Democratic nominee Hillary Clinton, in a high pressure probe seven days before the US presidential election. What will come out of it and when is not known, but the impact of the FBI's bombshell discovery of a new trove of Clinton emails is already reverberating in the neck-and-neck race for the White House. / AFP / JEWEL SAMAD (Photo credit should read JEWEL SAMAD/AFP/Getty Images) Getty

So much hangs on the accuracy of the individual state-by-state polls – especially those in the big states – and not on the nationwide polls.

These state polls underline the vulnerability of Clinton’s lead. The winning post is 270 electoral college votes. At the moment the polls only put her clearly ahead in states worth 248 votes. To get past the winning post, she needs to secure a couple of states – most likely Pennsylvania (20 college votes) and New Hampshire (4 votes), where her lead is a little less certain. At the same time, she has to avoid an upset in a state such as Michigan or Virginia that should be safely in her column.

Conversely, of course, she might yet win quite handsomely. If the polls are underestimating her lead by as much as two to three points, then another half a dozen states worth between them 81 votes could yet swing her way, enough to give her a 353 to 185 vote victory.

Certainly, if Donald Trump fails to pick up the big states that are currently on a knife-edge, most notably Florida and North Carolina, it is difficult to see how he will be able to defy the polls.

Doubtless at the back of Clinton’s mind will be the way Trump did sometimes defy the polls during the primary season. Meanwhile, the Republican standard bearer himself is fond of referring to the unexpected outcome (at least to some) of the EU referendum in Britain.

President Obama addresses a Trump supporter being heckled by a rally

There are certainly some similarities between the pattern of Trump’s appeal and that for Brexit. In the UK, voters with fewer educational qualifications were more likely to vote to Leave the European Union. Similarly, Trump is ahead among those without a college degree – and well behind among those who do.

Four years ago, in contrast, those with and without a college degree divided between Barack Obama and Mitt Romney in much the same way. This change in the demography of the Republican vote creates a greater degree of uncertainty about the outcome – and, as in the Brexit referendum, places a premium on the polls having got the educational profile of those they interview right.

But in a contest as close as this one appears to be, much could depend on turnout. Forecasting who exactly will make it to the polls is always one of the hardest tasks facing pollsters. There will, in truth, be relief as much as triumph amongst the pollsters if, in the end, they have called the winner right.