The exit poll for this year’s General Election will be published just after polling stations close later today, Thursday 4 July.

Exit polls take place at about 144 polling stations across the country, with tens of thousands of people asked to privately fill in a replica ballot as they leave, to get an indication of how they voted.

Its purpose is to predict the number of seats each party will win. But how accurate is it and has it ever been wrong before?

Has the exit poll been wrong before?

In 2017, the exit poll predicted a shock hung parliament, despite Theresa May's party leading opinion polls throughout the campaign. In the end, the Tories won 317 seats, just three more than the exit poll had predicted, and Labour took 262, four fewer than the poll suggested.

In 2015, many pundits believed the exit poll was incorrect, with former Lib Dem leader Paddy Ashdown famously promising to 'eat his hat' if it turned out to be right, but in the end, it proved to be more accurate than opinion polls during the campaign.

The poll did not predict a Conservative majority but it did show that the Tories were more popular than previously estimated. The poll suggested the Tories would be 10 seats short of an absolute majority, but in the end they won 14 more seats than the poll predicted.

Some earlier exit polls, however, have been less accurate. In 1974, the first British exit poll predicted a Labour majority of 132, but the actual majority was three. In 1992, the exit poll predicted the election would result in a hung parliament, when in fact Tory prime minister John Mayor had won a slim majority.

Recommended reading:

Famous celebrities cast their ballots on election day

Reform voter demands 'why isn't Farage on South Wales ballot'

'Dogs at polling stations' goes viral - see some favourites

What is the exit poll?

The poll – commissioned by Sky News, BBC and ITV News – is designed by an academic team of political scientists, led by Professor Sir John Curtice of Strathclyde University, and is carried out by the research company Ipsos.

Curtice told the PA news agency: “Wherever possible we go back to the same places as last time. The method of the exit poll is that you compare the results in the selected polling stations this time, with the results of the exit poll last time.”

As well as the identical ballots, a replica ballot box is used as part of the process;  Sir John said it’s done in this way to “maximise the confidentiality of people’s votes”.

He added: “To ask them to tell an interviewer, then they might be reluctant to do that, so you’re trying to minimise the level of refusal, which is always an issue.”