Do you need **calculate the sample size**? Use our online calculator and you will be able to get the right sample size for the population you want to investigate.

To use the **sample size calculator** you only need to fill in four essential pieces of information: the size of the population, the percentage of deviation, the maximum percentage of error that you allow and the confidence level. If you don't know what these parameters are, read on to get a good understanding of how to calculate a sample size.

Article sections

## Data to calculate the sample size

In order to calculate the sample size **a number of factors must be known** we will tell you about below:

**Margin of error**is defined as the range in which we want to find the data to be analyzed within the population. The margin of error usually represents a mean or a proportion. Note that if you reduce the margin of error, we have to increase the sample size for the result to be reliable. In turn, if we increase the sample size we can reduce the margin of error or increase the confidence level.**Confidence level**This data represents the confidence that we have that the data we want is within the margin of error.**Population**population: is the group of elements that share a common characteristic (for example, the inhabitants of the same city). The population can be finite or infinite. A finite population is one that is delimited and we know how many members are in it, while an infinite population is one that is delimited but we do not know how many members are in it.**Standard deviation**if we do not know its value we will use a 50%.

With all these data, we can calculate the sample size from the formula we will see in the next point.

## Formula for calculating a representative sample

This is the formula you should apply to calculate the sample size:

Being:

- N the size of the population or universe
- e is the margin of error
- p is the proportion that we want to find and that corresponds to the value of the standard deviation that we saw in the previous section. If we do not know its value, we will use a 50%, i.e. 0.5 in the formula.
- Z is a constant that depends on the confidence level and whose values are taken from the standard normal distribution table N(0,1). Here are the most commonly used Z values according to their confidence level:

Confidence level | Value of Z |
---|---|

75% | 1.15 |

80% | 1.28 |

85% | 1.44 |

90% | 1.65 |

95% | 1.96 |

97,5% | 2.24 |

99% | 2.58 |

**If the population size is very large** (more than 100,000 elements), the above formula can be simplified and would look like this:

## Solved example to calculate sample size

We are going to see a **exercise solved in which we are asked to calculate the sample size** for a city with a population of 80,000 inhabitants and we want to know the percentage of them living in rented accommodation, with a margin of error of 5% and a confidence level of 95% (Z = 1.64)

Since the population size is less than 100,000, we will use the full formula to calculate the sample size:

n = [80,000 x 1.64^{2} x 0,5 x (1 - 0,5)] / [(80.000 - 1) x 0,5^{2} + 1,64^{2} x 0,5 x (1 - 0,5)] = 383

Ingeniero de Telecomunicaciones dedicado al mundo de Internet. En esta web te ayudo a hacer cálculos y conversiones sencillas que con el paso de los años se nos ha olvidado cómo se hace. Si tienes dudas, déjame un comentario y te ayudaré. Si quieres mejorar tu proyecto online o necesitas asesoramiento, write me a message.

very interesting, and thanks for the operational simplification.

Hello Ulises,

Thank you very much for taking the time to leave us this comment. We are glad you liked it.

Greetings!