Media playback is unsupported on your device Media caption The BBC's Catriona Renton explains the details of when and how to cast a vote

On Thursday 23 June, the UK goes the polls in the EU referendum. Here's how to vote.

When can I vote?

The referendum takes place on 23 June, between 07:00 and 22:00 BST. Provided you are at the polling station at 22:00 BST, you will be guaranteed the opportunity to vote.

What are we voting for?

The referendum will decide whether the UK should leave or remain in the European Union.

You will be asked to answer the following question: "Should the United Kingdom remain a member of the European Union or leave the European Union?"

Whichever side gets more than half of all votes cast is considered to have won.

Where do I vote?

If you are on the electoral register, you should have received a polling card through the post which has your name, polling number and the address of your polling station printed on it.

Polling stations are usually set up in public buildings such as schools, community centres and village halls near where you live.

If you have not received a polling card but think you should have, contact your local authority's election office.

If you have lost your polling card, the office will be able to tell you where your polling station is.

To find the contact details of your local office, enter your postcode on the About My Vote website.

Do I need to take my polling card with me?

Image copyright EPA

No. The polling card is for your information only, but taking it to the polling station can speed up the process.

Can I go to any polling station?

No. You must vote at the polling station to which you have been assigned.

Any voter who has not had a chance to post their postal vote (if they have asked for one) can still take it to their polling station in person, apart from in Northern Ireland.

What do I do when I get to the polling station?

When you arrive, staff will take your details and cross off your name on their checklist. In Northern Ireland, staff will also ask for a form of photographic ID.

What happens next?

You will be given a ballot paper listing two options: "Remain a member of the European Union" or "Leave the European Union". It will be printed on special paper or feature an official mark or number to combat fraud.

Then I vote?

Yes. Take the ballot paper to one of the booths, which are screened to ensure secrecy.

Each polling booth should include sharpened pencils, attached to string long enough to accommodate both right and left-handed voters. You can use you own pen or pencil if you prefer.

Read the ballot paper carefully before you vote.

How do I vote?

Put an X in the box which reflects your choice. If you mark any more boxes, your paper will be invalid.

Can I put a smiley face instead?

The Electoral Commission says the best way to make sure your vote is counted is to mark an X in a box. But a smiley face or anything which is interpreted by a returning officer as an expression of preference "must not be rejected if the voter's intention is clear", its guidance to Counting Officers says.

Can I take a selfie?

There's nothing in the law that specifically bans taking photos, but the Electoral Commission strongly discourages any photography inside a polling station, "as you might find yourself in breach of secrecy of the ballot requirements". Anyone who inadvertently reveals how someone else votes could face a £5,000 fine or six months in prison. Consequently, you will see "no photography" signs inside many polling stations. The Commission advises it would be better to take a photo outside the polling station to use on social media.

What do I do with my marked ballot paper?

Fold the ballot paper so others cannot see your choice and post it in the ballot box.

What if I make a mistake?

You can get your ballot paper reissued, so long as you have not put it in the ballot box.

Can I spoil my ballot paper?

Yes. The verification of the used, unused and spoilt ballot papers is a legal requirement. Some people spoil their votes as a means of registering their democratic right to express a view, but not vote for any of the options.

I have got a disability. Can I get help?

Yes, everyone has the right to request assistance to mark their ballot paper. You can do this by asking the presiding officer to mark the paper for you. Or bring a close family member who is over 18, or someone who is eligible to vote at the election, such as a support worker, with you.

If you have a visual impairment, you can ask for a special voting device that allows you to vote on your own in secret. A large print version of the ballot paper should also be clearly displayed in the polling station.

Returning officers must also consider accessibility requirements when planning for election, and polling stations are selected in consultation with local disability groups so that wheelchair ramps and disabled parking spaces are available.

If a voter cannot enter the polling station because of a physical disability, the presiding officer may take the ballot paper to the elector.

I have a learning disability. Can I get help?

Yes if you need help, call the Electoral Commission's public information line on 0333 103 1928.

A dedicated helpline for anyone with a learning disability who has questions about casting their vote, or experiences any difficulties in doing so, has also been set up by Mencap, a partner of the Electoral Commission.

The helpline is also available to the families and carers of people with learning disabilities, and to polling station staff - but is not for general queries from members of the public. The number to call is 020 7696 6952. If you are unable to reach somebody on that number, you can then call 07506 921 856.

What if I cannot get to a polling station?

Image copyright Reuters

If you are suddenly incapacitated or taken ill on polling day, you can apply for an emergency proxy up until 17:00 BST on the day.

I forgot to register, can I vote?

No, you cannot vote unless you are on the electoral register.

Is it compulsory to vote?

No, people cannot be forced to vote.

When will I know the result?

Image copyright Getty Images Image caption How votes are typically counted

The votes will start to be counted as soon as the polls close at 22:00 BST, and counting will continue overnight until a final result is declared.

There will be 382 counting areas - 380 local authorities across England, Scotland and Wales and one in Northern Ireland, and one in Gibraltar.

The official declaration will be made at Manchester Town Hall. It is difficult to predict when a final total will be declared, but the level of turnout and how close the result is will have a bearing on time.

BBC One, the BBC News Channel and BBC Parliament will broadcast a results show hosted by David Dimbleby alongside BBC experts and special guests from 21:55 BST. Coverage continues throughout the night and Sophie Raworth, Andrew Neil and Victoria Derbyshire pick up the coverage on Friday morning.

Viewers outside the UK can join the results programme on BBC World News from 22:00 GMT.

BBC Radio 4 will be broadcasting the EU referendum results in a programme from 23:00 BST, that will run until Friday's Today programme at 06:00 BST. BBC Radio 5 Live will also have live coverage as the results come in.

And, of course, there will be comprehensive coverage online with live updates throughout polling day and overnight, as well as up-to-the minute results.