First, to compute the margin of error with the formulas below, you need to gather a few pieces of data from the poll. The most important is the sample size "n" which is simply the number of people who responded to your survey. You also need the proportion "p" of people who gave a particular answer, expressed as a decimal.
If you know the total size of the population from which your sample was drawn, call this number capital "N" to represent the total number of people.
For a sample drawn from a very large population (N larger than 1,000,000) compute the "95% confidence interval margin of error" with the formula
MOE = (1.96)sqrt[p(1-p)/(n)]
As you can see, if the total population is large enough, only the size of the random sample matters. If the survey has multiple questions and there are several possible values for p, pick the value that is closest to .5.
For example, suppose a poll of 800 Californians shows that 35% of respondents are in favor of a proposition, 45% are against, and 20% are undecided. Then we use p=.45 and n=800. So the margin of error for 95% confidence is
(1.96)sqrt[(.45)(.55)/(800)] = .0345,
or about 3.5%. This means that we can be 95% sure that a repeat survey would yield results that only differ by about 3.5% in either direction.
For practical purposes, people often use the simplified margin of error formula, given by the equation
MOE = 0.98sqrt(1/n)
This simplified formula is obtained by replacing p with .5. If you are mathematically inclined, you can check that this substitutions will yield the formula above.
Because this formula gives a larger value than the previous formula, it is often called the "maximum margin of error." If we use it for the previous example, we get a margin of error of .0346, which is about 3.5% again.
The two formulas above work for random samples drawn from an extremely large population. However, when the total population for a survey is much smaller, a different formula for margin of error is used. The formula for margin of error with "finite population correction" is
MOE = 0.98sqrt[(N-n)/(Nn-n)]
For example, suppose a small college has 2,500 students and 800 of them answer a survey. With the formula above, we calculate the margin of error to be
0.98sqrt[1700/2000000-800] = .0286
So these survey results have a margin of error around 3%.