Sample Size Calculator

Sample Size Calculator

Popular AI Skill PRO

Enter Calculation

Formula

n=z2p(1−p)e21+z2p(1−p)e2Nwhere{N=Population Sizez=Φ−1(1−1−Confidence/1002)e=Margin of Error (%)100p=0.5\begin{gathered} n = \dfrac{\dfrac{z^{2}\,p\,(1-p)}{e^{2}}}{1 + \dfrac{z^{2}\,p\,(1-p)}{e^{2}\,N}} \\[1.5em] \text{where}\quad \left\{ \begin{aligned} N &= \text{Population Size} \\ z &= \Phi^{-1}\!\left(1 - \tfrac{1 - \text{Confidence}/100}{2}\right) \\ e &= \dfrac{\text{Margin of Error (\%)}}{100} \\ p &= 0.5 \end{aligned} \right. \end{gathered}
Usage stats

Advertisement

Results

Required Sample Size:
384
Population Size 1,000,000
Confidence Level 95.0%
Margin of Error 5.0%
Z-Score 1.9600

Report an error on this page

What This Sample Size Calculator Does

This calculator tells you how many people (or items) you need to survey to get statistically reliable results for a given population. It uses the standard finite-population correction formula, so the answer is tailored to the size of your target group rather than assuming an infinitely large population. It's used worldwide for surveys, polls, market research and academic studies — the statistics are universal and not specific to any country.

The Three Inputs Explained

  • Population Size (\(N\)): The total number of individuals in the group you want to draw conclusions about — for example, 50,000 registered customers. The default is 1,000,000.
  • Confidence Level (%): How sure you want to be that the true value falls within your margin. Common choices are 90%, 95% and 99%. The calculator converts this into a z-score using the normal distribution (95% → \(z \approx 1.96\)).
  • Margin of Error (%): The acceptable range of error around your result, e.g. ±5%. A smaller margin requires a larger sample.
Diagram showing margin of error as an interval around a sample estimate on a number line
Margin of error defines the range around your estimate, while confidence level reflects how often that range captures the true value.

The Formula

The calculator applies the finite-population corrected sample size formula:

$$n = \dfrac{\dfrac{z^{2}\,p\,(1-p)}{e^{2}}}{1 + \dfrac{z^{2}\,p\,(1-p)}{e^{2}\,N}}$$

Here \(z\) is the z-score from your confidence level, \(p\) is the assumed response proportion (fixed at 0.5 because that maximises the required sample and gives the safest estimate), \(e\) is the margin of error as a decimal, and \(N\) is the population size. The result is rounded up so you never under-sample.

Advertisement
Standard normal bell curve with two symmetric shaded tails and central confidence region marked by z critical values
The z-score is the critical value of the standard normal distribution corresponding to your chosen confidence level.

Worked Example

Suppose your population is 50,000 people, you want 95% confidence and a 5% margin of error.

  • \(z = 1.96\), \(p = 0.5\), \(e = 0.05\), \(N = 50{,}000\)
  • Numerator: $$1.96^{2} \times 0.5 \times 0.5 / 0.05^{2} = 0.9604 / 0.0025 = 384.16$$
  • Denominator: $$1 + 384.16 / 50{,}000 = 1.00768$$
  • $$n = 384.16 / 1.00768 \approx 381.2 \rightarrow \text{rounded up to } \mathbf{382}$$

So you'd need to survey 382 people.

Z-Scores for Common Confidence Levels

The calculator converts your confidence level into a two-tailed z-score, \(z = \Phi^{-1}\left(1 - \alpha/2\right)\), where \(\alpha = 1 - \text{confidence level}\). Higher confidence means a larger z-score and therefore a larger required sample.

Confidence level Alpha (1 − confidence) Two-tailed z-score
80% 0.20 1.282
85% 0.15 1.440
90% 0.10 1.645
95% 0.05 1.960
98% 0.02 2.326
99% 0.01 2.576
99.9% 0.001 3.291

Interpreting Your Sample Size

  • Completed responses, not invitations. The result is the number of completed, valid responses you need. If you expect a 20% response rate, you must contact about five times as many people.
  • Random sampling is assumed. The sample size supports the stated margin of error and confidence level only if respondents are selected at random from the population. Convenience samples or heavy non-response can bias results no matter how large n is.
  • Subgroups have wider margins. The margin of error applies to the whole sample. If you analyze a subgroup, its margin is based on the subgroup's own count. For example, with p = 0.5 and 95% confidence, a subgroup of 100 has a margin of about \(1.96\sqrt{0.25/100} \approx 0.098\), or ±9.8%.
  • Diminishing returns. Because \(n \propto 1/e^{2}\), halving the margin of error roughly quadruples the required sample. At 95% confidence and a large population, ±5% needs about 385 responses, while ±2.5% needs about 1,537.
  • Finite-population correction. The correction factor \(1 + \dfrac{n_0}{N}\) in the formula matters mainly when the sample is more than about 5% of the population. For a very large population, the result barely changes with N.

Example: with N = 10,000, 95% confidence and a 5% margin of error, first compute \(n_0 = \dfrac{1.96^{2}\cdot 0.5\cdot 0.5}{0.05^{2}} = 384.16\). Then \(n = \dfrac{384.16}{1 + 384.16/10000} = \dfrac{384.16}{1.038416} \approx 369.97\), which rounds up to 370 completed responses.

The calculator assumes p = 0.5, the most conservative proportion, which gives the largest sample. If you have a reliable prior estimate of the proportion, a smaller sample may suffice, but 0.5 is a safe default. This is general statistical information, not financial or medical advice.

Advertisement

See also

Planning an A/B test? The A/B test sample size & power calculator tells you how many visitors each variant needs and gives the exact Bayesian probability that B beats A.

Test already finished? The A/B test significance calculator checks whether the gap between two conversion rates is statistically significant, with the z-score and p-value.

Frequently Asked Questions

Why is \(p\) set to 0.5? When the true proportion is unknown, 0.5 produces the largest possible sample size, ensuring your survey is precise enough regardless of the actual result.

What if my population is very large? For huge populations the correction term becomes negligible, so the sample size approaches the simpler \(n = z^{2}p(1-p)/e^{2}\) (about 385 for 95%/5%).

How do I shrink the required sample? Accept a larger margin of error or a lower confidence level. Tightening either one increases the sample needed substantially.

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators