All you need to know about how the EU referendum votes will be counted

bowls of sweets and crisps
Image caption Votes will first be counted up in 382 separate pots. Also these are the essential food groups for staying up all night

After weeks and weeks of campaigning, the EU referendum vote is taking place on Thursday.

Polling stations will be open from 7am until 10pm.

Registered voters will be able to choose between the UK leaving or remaining a part of the European Union.

And then what? The counting happens.

But it's not like a general election. Here's why.

The team with the most votes wins

It really is that simple. To get over the winning line, one side must get 50% of the votes plus one vote or more.

Ballot boxes stacked up on each other

There won't be a winning prediction at 10pm

Bad news for anyone wanting to go to bed with an idea of what sort of Britain they'll be waking up to.

The reason there'll be no exit poll is because the chances of getting it wrong are too great.

During a general election, organisations use past results and trends to help predict the result. They can't do that with the referendum.

The first results will come in around 12:30am

There are 382 counting areas. Some will only have a few thousand votes to count, others hundreds of thousands.

Each region has predicted when they'll finish counting. And there are big differences in timings.

Sunderland prides itself on a quick count and thinks it'll declare by 12.30 on Friday morning.

But we'll have to wait until nearer 7am before Cheshire East has a result.

Then at some point these will be put into 12 massive piles across the UK.

The result should be known BEFORE the official announcement

Counting ballot papers during an election

The Electoral Commission can't officially say whether the UK has voted to remain in or leave the EU until each region has formally declared.

But luckily, lots of people with calculators will be frantically punching in the numbers throughout the night.

They're looking for turnout figures. Once they know how many people who could have voted have actually voted, they can work out how many votes are needed to get to 50% plus one.

That magic number should be known around 4am. That's when things will get really exciting - and you'll need to restock the salty snacks if you intend to power through to the morning.

Even if some results are still to come, it should be possible to start predicting which way the vote is heading - and which side will be getting ready for the early morning champagne and Wotsits.

The official announcement will be made from Manchester Town Hall.

If there's a dead heat, things get tricky

The chances are so small that there isn't a plan on what to do. Instead, it would be up to parliament to decide.

And that could take a long, long time.

Find us on Instagram at BBCNewsbeat and follow us on Snapchat, search for bbc_newsbeat