Convert your desired confidence level to a z-score with a z-score table. For example, a 98 percent confidence interval would have a z-score of 2.326.
Subtract your proportion from 1 to find the opposite proportion. To err on the side of caution, use a proportion of 0.5. For example, if you expect an election to be very close, use a proportion of 0.5 so you subtract 0.5 from 1 to get 0.5.
Multiply the z-score by your proportion by 1 minus your proportion. In this example, multiply 2.326 by 0.5 by 0.5 to get 0.5815.
Multiply your confidence interval by itself. For example, in this example, if you want a confidence interval of 0.02, or 2 percent, multiply 0.02 by 0.02 to get 0.0004.
Divide the Step 3 result by the Step 4 result to find the minimum sample size for the test. In this example, divide 0.5815 by 0.0004 to get a minimum sample size of 1454.