Sample size calculator with standard deviation and confidence interval

Created by Bogna Szyk

Reviewed by Steven Wooding

Last updated: Mar 12, 2022

If you're conducting research and wonder how many measurements you need so that it is statistically significant, this sample size calculator is here to help you. All you need to do is ask yourself these three questions before you use it:

  • How accurate should your result be? (margin of error)
  • What level of confidence do you need? (confidence level)
  • What is your initial estimate? (proportion estimate)

Read on to learn how to calculate the sample size using this tool, and what do all the variables in the sample size calculation formula mean.

Sample size calculation formula

The equation that our sample size calculator uses is:

n₁ = Z² * p * (1-p) / ME²

where:

  • Z — The z-score associated with the confidence level you chose. Our statistical significance calculator calculates this value automatically (shown in Advanced mode), but if you want to learn how to calculate it by hand, take a look at the instructions of our confidence interval calculator.
  • ME — Margin of error, also known as the confidence interval. It tells you that you can be sure (with probability of confidence level, for example 95%), that the real value doesn't differ from the one that you obtained by more than this percentage.
  • p — Your initial proportion estimate. For example, if you are conducting a survey among students trying to find out how many of them read more than 5 books last year, you may know a result of a previous survey — 40%. If you have no such estimate, use the conservative value of 50%.
  • n₁ — Required sample size.

If your population is finite — for example, you are conducting a survey among students of only one faculty — you need to include a correction in the following form:

n₂ = n₁ / (1 + n₁ / N)

where:

  • N — Total population size.
  • n₂ — Size of the sample taken from the whole population that will make your research statistically significant.

How to calculate sample size: an example

We will analyze a survey case step-by-step, so you can get a clear picture of how to use our sample size calculator. You are planning to conduct a survey to find out what is the proportion of students on your campus who regularly eat their lunch at the campus canteen.

  1. Decide how accurate you want your result to be. Let's say that it is important for the canteen to know the result, with a margin of error of 2% maximum.
  2. Decide on your confidence level. We can assume you want to be 99% sure that your result is correct.
  3. Do you have an initial proportion guess? Let's say you accessed a similar survey from 10 years ago and the proportion was equal to 30%. You can assume it as your initial estimate.
  4. Is the total population of students so high that you can assume it's infinite? Probably not. You need to find the current data for the number of students on the campus — let's assume it is 25,000.
  5. All you need to do now is to input all this data into our sample size calculator. It finds the sample size required for the result to be statistically significant is 3,051. You need to ask that many students the same question… Are you sure you can't settle for a 95% confidence level? 😀

Now that you know how to calculate sample size, you can go beyond and use it to calculate other statistics of interest in your research:

  • Sampling error calculator: sample size is the most influential feature when predicting the sampling error. Use it to calculate the error of your sample.
  • Normal probability calculator for sampling distributions: use your sample size, along with the population mean and standard deviation, to find the probability that your sample mean falls within a specific range.
  • Sampling distribution of the sample proportion calculator: use your sample size and the population proportion to find the probability that your sample proportion falls within a specific range.

Correction for finite population

5 number summary5★ rating average6 sided dice probability… 131 more

How do you find the sample size when given the standard deviation?

First multiply the critical value by the standard deviation. Then divide this result by the error from Step 1. Now square this result. This result is the sample size.

What sample size do I need for 95 confidence?

To be 95% confident that the true value of the estimate will be within 5 percentage points of 0.5, (that is, between the values of 0.45 and 0.55), the required sample size is 385. This is the number of actual responses needed to achieve the stated level of accuracy.