Skip to main content

Sample Size Calculator

Calculate the survey sample size needed for a target margin of error.

Reviewed for accuracy by the Math Ora X team Last updated

Result

About the Sample Size Calculator

Determines how many responses you need for a survey to achieve a given margin of error at a chosen confidence level, with an optional finite-population correction.

$$ n = \frac{z^2 p(1-p)}{e^2} $$

How to use this calculator

  1. Choose your confidence level, then get the matching z value, such as 1.96 for 95%.
  2. Enter an estimated proportion p, or use 0.5 if you do not know it because that gives the largest required sample.
  3. Enter your desired margin of error e as a decimal, such as 0.04 for 4%.
  4. Compute n with the formula, then round up to the next whole person because you cannot survey a fraction of a person.

The formula explained

The formula computes the minimum sample size needed to estimate a population proportion with a chosen margin of error, assuming a normal approximation. The value of p controls how variable the population is, and the margin of error sets how precise you want the estimate to be.

  • n = required sample size
  • z = z score for the chosen confidence level
  • p = estimated population proportion
  • e = desired margin of error, written as a decimal

Step by step method

  1. Identify the confidence level and write down its z value.
  2. Choose p, often 0.5 if no prior estimate is available.
  3. Plug z, p, and e into \(n = \frac{z^2 p(1-p)}{e^2}\).
  4. Round the result up to the next whole number.

Worked example

Problem. How many people should you survey to estimate a proportion with 95% confidence, a margin of error of 4%, and no prior estimate for p?

  1. Use 95% confidence, so \(z = 1.96\). Set \(p = 0.5\) and \(e = 0.04\).
  2. Substitute into the formula: \(n = \frac{1.96^2 \cdot 0.5(1-0.5)}{0.04^2} = \frac{3.8416 \cdot 0.25}{0.0016}\).
  3. Compute \(n = 600.25\), then round up to 601.

Answer. 601 people

Tips and common mistakes

  • Always enter the margin of error as a decimal, so 5% becomes 0.05, not 5.
  • If you do not know p, use 0.5, because it gives the safest, largest sample size estimate.

Frequently asked questions

What proportion should I use?+

If unknown, use 0.5, it gives the largest, safest sample size.

When do I add the population size?+

For small populations; it reduces the required sample via the finite-population correction.

More Mathematics Tools

Explore related calculators in this category

You Might Also Like

Popular tools from other categories

Can't Find the Right Calculator?

Try our AI Math Solver, type any problem in plain English and get instant step-by-step solutions.

Try AI Solver

Browse All Categories

Home Mathematics Current Tool
Facebook Twitter WhatsApp