Sample Size Calculator

Enter the margin of error you can accept and a confidence level to find the sample size.

The most the estimate may be off by, more than 0 (0.03 for 3%).

Confidence level

How sure the interval should be of containing the true value.

Optional: leave empty to use 0.5, which gives the largest sample size.

Try

Result

You enteredE=0.03, p=0.5, 95%E = 0.03,\ p = 0.5,\ 95\%

1068\displaystyle 1068

Before rounding

1067.071895\displaystyle 1067.071895
Show the work
  1. Critical value from the normal distribution

    The critical value z∗z^* marks off the middle 95% of the standard normal curve, leaving 2.5% in each tail, so the area to the left of z∗z^* is 0.975.

    z∗=Φ−1(0.975)≈1.959964z^* = \Phi^{-1}\left(0.975\right) \approx 1.959964
  2. Sample size for a proportion

    Solving the margin of error formula E=z∗p(1−p)nE = z^*\sqrt{\frac{p(1-p)}{n}} for nn gives this. With no estimate of pp, use p=0.5p = 0.5: it makes p(1−p)p(1 - p) as large as possible, so the sample is big enough whatever the true proportion is.

    n=z∗2 p(1−p)E2=1.9599642×0.5×0.50.032≈1067.071895\begin{aligned} n &= \frac{z^{*2}\,p\left(1 - p\right)}{E^2} \\ &= \frac{1.959964^2 \times 0.5 \times 0.5}{0.03^2} \approx 1067.071895 \end{aligned}
  3. Rounding up to a whole number

    A sample size must be a whole number, and rounding down would make the margin of error larger than the E=0.03E = 0.03 asked for, so always round up to the next whole number.

    n=⌈1067.071895⌉=1068\begin{aligned} n &= \lceil 1067.071895 \rceil \\ &= 1068 \end{aligned}
  4. Result

    So a sample of at least 10681068 is needed.

Worked examples