Sample Size

Survey sample size or margin of error for a proportion

About this calculator

The Sample Size Calculator finds how many survey responses you need to estimate a proportion within a chosen margin of error, or the margin of error a given sample delivers. It uses n₀ = z² · p(1 − p) / E² with z = Φ⁻¹(1 − α/2), and applies the finite-population correction n = n₀ / (1 + (n₀ − 1) / N) when you enter a population size. In reverse, E = z · √(p(1 − p) / n) · √((N − n) / (N − 1)). Results are rounded up to whole respondents, and a chart shows how the margin of error shrinks as the sample grows. Useful for polls, customer surveys, market research, and A/B tests.

How to use the Sample Size calculator

  1. Enter the values for your problem into the input fields.
  2. Read the result — it updates instantly as you type.
  3. Check the formula and the visual explanation to follow how the answer was found.
  4. Copy the page URL to share the exact calculation.

Common examples

  • 95% confidence, ±5% margin, p = 50% → n = 385 (n₀ ≈ 384.15)
  • Same survey with a population of N = 2,000 → n = 323
  • 99% confidence, ±3% margin, p = 50% → n = 1,844
  • 95% confidence, ±2% margin, p = 10% → n = 865

Frequently asked questions

How does the Sample Size calculator work?

Enter your values and the calculator applies the exact mathematical method for this problem, showing the result together with the formula it used. Everything is computed with high-precision arithmetic, so the answer you see is not limited by ordinary floating-point rounding.

When would I use the Sample Size calculator?

It is useful for homework and exam preparation, for checking work done by hand, and whenever a step in a larger problem needs this calculation done quickly and reliably.

How accurate are the results?

Calculations run at 30 significant digits of precision internally. Displayed values are rounded for readability, but the underlying result is far more precise than a typical hand or pocket-calculator computation.

Can I share a specific calculation with someone else?

Yes. Every value you enter updates the URL, so copying the address bar and sharing the link reopens the exact same calculation for whoever clicks it.