Przejdź do treści
Liczbnik
Current for 2026Methodology

Sample Size Calculator

Enter the confidence level (90%, 95% or 99%), expected proportion (p = 0.5 gives the largest sample for the worst case), and acceptable margin of error. The calculator returns the minimum number of respondents. Optionally provide the population size to apply the finite population correction and reduce the required sample.

Na tej stronie

How we calculate sample size

We apply the formula n = (z^2 * p * (1-p)) / e^2, where z is the critical value of the normal distribution for the chosen confidence level (90% -> 1.645; 95% -> 1.960; 99% -> 2.576), p is the expected proportion and e is the margin of error. The result is rounded up (Math.ceil). When population size N > 0 is provided, the finite population correction is applied: n_adj = n*N / (n+N-1).

Example: nationwide opinion poll

You want a survey with 95% confidence level, 5% margin of error and unknown response distribution (p = 0.5). Formula: n = (1.960^2 * 0.5 * 0.5) / 0.05^2 = 384.16 -> rounded up n = 385. If the population is 1,000 people, the finite correction reduces the sample to about 278 respondents.

Frequently asked questions

What is sample size?

Sample size (n) is the minimum number of respondents or observations needed for survey results to be representative of the entire population with a specified accuracy and confidence level. A larger sample reduces the margin of error but increases cost and time.

How does the sample size formula work?

The basic formula is n = (z^2 * p * (1-p)) / e^2, where z is the normal distribution quantile for the chosen confidence level, p is the expected proportion, and e is the acceptable margin of error. The result is rounded up to the nearest integer.

What is a confidence level and how do I choose one?

A 95% confidence level means that if the study were repeated many times, 95% of the resulting confidence intervals would contain the true population parameter. Social and market research typically uses 95%; scientific and medical research often requires 99%.

The margin of error e is the maximum acceptable difference between the sample result and the true population parameter. For example, e = 0.05 means the result may differ by at most 5 percentage points from the true value. A smaller margin of error requires a larger sample.

When the expected proportion is unknown, use p = 0.5. This is the conservative worst-case scenario because p*(1-p) is maximised at 0.25, producing the largest possible sample size and ensuring adequate precision regardless of the true proportion.

The basic formula assumes an infinite population. When the population size N is known, apply the correction: n_adj = n*N / (n+N-1). This reduces the required sample size. The correction makes a significant difference when N is small relative to the uncorrected n.

For large populations (millions), the required sample is almost the same as for a population of 10,000. Sample size depends primarily on the desired precision (e), not on population size. The finite population correction only matters when N is relatively small.

For national surveys, a typical sample is 1,000-1,500 with e=3% at 95% confidence. For local or segment research, 300-500 may suffice. The calculator gives the statistical minimum; in practice, you should account for non-response and sampling method.

The sample size formula assumes random sampling where each element has an equal chance of selection. Non-random sampling methods (convenience, purposive) do not allow statistical guarantees of representativeness; the formulas do not apply to them.

A smaller margin of error means greater precision, but also a significantly larger sample and higher costs. Reducing e from 5% to 3% roughly quadruples the required sample size. The choice of margin of error should reflect the practical requirements and budget of the study.

Results are statistical estimates assuming simple random sampling. The calculator does not account for response rate, stratification or other methodological factors. For scientific research, consult a statistician.

  • Z-Score Calculator

    Calculate the z-score (standardized value) and its corresponding percentile in the normal distribution. Enter the value, mean and standard deviation — instant result.

  • Confidence Interval Calculator

    Calculate the confidence interval for a mean or proportion. Choose 90%, 95% or 99% confidence level, enter sample mean, standard deviation and sample size — instant result.