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.05, p=0.5, 95%E = 0.05,\ p = 0.5,\ 95\%

385\displaystyle 385

Before rounding

384.145882\displaystyle 384.145882
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.052≈384.145882\begin{aligned} n &= \frac{z^{*2}\,p\left(1 - p\right)}{E^2} \\ &= \frac{1.959964^2 \times 0.5 \times 0.5}{0.05^2} \approx 384.145882 \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.05E = 0.05 asked for, so always round up to the next whole number.

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

    So a sample of at least 385385 is needed.

Worked examples