All Canadians incarcerated in provincial, territorial or federal institutions have the right to vote in the Oct. 21 election. And they are a potentially large voting block.

In 2017-2018, there were 38,786 adults in federal or provincial/territorial custody, according to Statistics Canada.

Voter turnout among incarcerated Canadians in the 2015 federal election was 50.5 per cent, compared with an overall turnout of 68 per cent for the general population.

Prisoners clearly can't go to a polling station, so how do they cast their ballot? And with no access to the internet, how do they know who to vote for?

Here's how it happens.

First, a little history.

Canadians behind bars have not always been allowed to vote. That changed in 1993, when Parliament amended the law to allow prisoners serving sentences of less than two years to vote. Individuals serving longer sentences were still not able to cast ballots.

Then a prisoner serving a 25-year sentence challenged the law. And in 2002, the Supreme Court of Canada ruled that denying longer term inmates the ability to vote was a violation of their Charter rights.

Since then, all incarcerated Canadians at the provincial/territorial or federal level have had the right to vote in elections and referendums, provided they are 18 years or older on election day. And every institution must designate a liaison officer who will work with Elections Canada to facilitate the vote for prisoners.

How do prisoners register to vote?

Prisoners need to fill out a form called the Application for Registration and Special Ballot to register to vote. They can get this from their liaison officer as soon as an election or referendum is called. Once it's filled out, prisoners need to return it to their liaison officer for validation.

What riding do they vote in?

It's not always straightforward. Where you live generally establishes your riding. But for elections, a prisoner's place of residence is not where he or she is incarcerated. Instead, Elections Canada will accept the first of the following places for which the elector knows the civic and mailing address, and that determines the correct riding:

His or her residence before being incarcerated. The residence of a spouse, common-law partner, relative or dependant. Other options are the residence of any relative of his or her common-law partner or spouse, or a person the prisoner would live with if not incarcerated. The place of his or her arrest. The last court where the prisoner was convicted and sentenced.

Voting day

There are some significant differences between how most Canadians vote versus those who are incarcerated.

Prisoners do not vote on election day. Instead, they vote on the 12th day before polling day. This year, that will be Oct. 9.

A polling station is set up in each institution, and must be open from 9 a.m. local time until all votes are cast or 8 p.m. local time — whichever comes first.

In regular polling stations, voters show something that proves their identity and current address. They can also have someone vouch for them.

In jail or prison, the voter is given a voting kit. He or she needs to sign a declaration acknowledging that his or her name is correctly shown on the envelope, that he or she has not voted already, and that he or she will not try to vote again in the same election.

And while voters at polling stations generally mark an X beside the name of their candidate of choice from a pre-written list on a ballot, the incarcerated voter writes the name of the candidate they want to vote for in their riding on the ballot and inserts it into an envelope.

That's a worry, said Catherine Latimer, executive director of the John Howard Society, given that some names are more complicated than others.

But Elections Canada says the ballots are opened and read out loud in a group of designated observers. If the group agrees on the voter's intention, even if the name is misspelled, the ballot is counted.

In the 2015 federal election, there were 22,362 ballots cast by Canadian prisoners, and 1,689 were rejected — about 7.5 per cent.

How do inmates get information about candidates?

They're kind of on their own. Prisoners can watch TV, so they can get information about the broader story of the election — where the different parties stand or what they are promising. But they have no access to the internet, so if they want information about the specific candidates in their riding, they're pretty much out of luck.

"They can vote," said Latimer, "but work could be done to make it easier for them."

She said often the best a prisoner can do is decide which party they want to vote for, and then just choose the candidate from that party in their riding, even though they may know little to nothing about him or her.

How does someone under house arrest vote?

There is nothing specific to voting while under house arrest — also known as conditional sentence — in the Elections Act. However, according to Elections Canada spokesperson Nathalie de Montigny, Canadians under house arrest have the same voting rights and options as other Canadians.

If they are allowed to leave their house, they can vote in advance, on election day or at any Elections Canada office during the campaign.