To millions of undecided voters, the choice between Democratic nominee Hillary Clinton and GOP nominee Donald Trump is no choice at all. And for some left-leaning voters who can not stomach throwing their support behind Clinton, her former primary opponent stills seems like a better option ... even if he has no shot of winning.

For voters who want to back Bernie Sanders at the ballot box instead of casting a vote for Clinton or Trump this election season, casting a write-in ballot is an easy and legitimate option. A willing voter needs only identify the write-in line on the ballot at their polling place and fill in their desired candidate's name. However, the effect of that vote varies depending on the state.

Not every state counts write-in votes. In nine states, write-in votes are not permitted. So, voters in Hawaii, Nevada, South Dakota, Oklahoma, Arkansas, Louisiana, Mississippi and South Carolina are stuck with Clinton, Trump, or one of the third party candidates on the ballot in those states, such as Libertarian nominee Gary Johnson or Green Party nominee Jill Stein.

In 34 states, candidates are required to file paperwork before the election in order for write-in votes for that candidate to be counted. That can include an affidavit, a filling fee or a filed petition as early one month before the election, depending on the state. If those requirements are not meant, the write-in votes for that candidate do not count. Independent conservative Evan McMullen is campaigning on a write-in strategy and claims to have confirmed write-in status in 32 states. Sanders, who is backing Clinton in the November race, has not taken this step, meaning votes for him in a majority of U.S. states would be meaningless electorally. While voters are free to make a protest vote, Sanders does not have a chance to win the election via write-in ballots.

But Sanders could steal some states. Seven states do not require any pre-registration for write-in candidates. Voters in New Jersey, Vermont, Rhode Island, New Hampshire, Iowa, Oregon and the crucial swing state of Pennsylvania can cast their vote for Sanders, or anyone else, and make it count.

Sanders, however, discourages this. He has endorsed Clinton and urged his supporters to do all they can to elect her and defeat Trump.

"Secretary Clinton has won the Democratic nominating process, and I congratulate her for that. She will be the Democratic nominee for president and I intend to do everything I can to make certain she will be the next president of the United States," he told supporters in July. "I have come here today not to talk about the past but to focus on the future. That future will be shaped more by what happens on Nov. 8 in voting booths across our nation than by any other event in the world. I have come here to make it as clear as possible as to why I am endorsing Hillary Clinton and why she must become our next president."

No national candidate has ever made significant headway via write-in ballots, but the strategy has precedent on the local level. Alaska Sen. Lisa Murkowski won re-election to the U.S. Senate as a write-in candidate in 2010 after losing the primary for the Republican nomination to a Tea Party-backed candidate.