Convert the confidence level from a percentage to a z-score using a z-score table. For example, if you wanted to be 95 percent sure that the true proportion was within the margin of error, you would get a z-score of 1.96.
Subtract the proportion of the poll from 1. For example, if the poll showed candidate A was getting 52 percent of the vote, you would subtract 0.52 from 1 to get 0.48.
Multiply the result from step 2 by the proportion. In this example, you would multiply 0.48 by 0.52 to get 0.2496.
Divide the result from step 3 by the sample size. Continuing the example, if the sample size was 500, you would divide 0.2496 by 500 to get 0.0004992.
Take the square root of the result from step four. In this example, you would take the square root of 0.0004992 to get 0.02234.
Multiply the result from step 5 by the z-score to calculate the margin of error. Finishing this example, you would multiply 0.02234 by 1.96 to get about 0.0438, meaning the margin of error would be about 4.38 percent.