Sample Size Calculator

Determining the correct sample size is critical for designing a reliable survey or study. This calculator determines the minimum sample size needed to estimate a population proportion within a specified margin of error at your chosen confidence level. Enter your confidence level (90%, 95%, or 99%), margin of error, and estimated population proportion. The calculator uses the standard formula for sample size estimation and returns the required number of observations rounded up to the next integer.

As decimal (e.g., 0.05 for 5%)
Between 0 and 1 (use 0.5 if unknown)
384

Sample size formula for proportion

n = z^2 * p * (1-p) / E^2

Where: z = critical value, p = estimated proportion, E = margin of error

How to use this calculator

  • Confidence Level: Choose 95% for most applications. Use 90% for less critical studies, 99% for very important decisions.
  • Margin of Error: How close you want your estimate to be. Use 0.05 (5%) for most surveys. Smaller margins require larger samples.
  • Estimated Proportion: Use 0.5 (50%) if you have no prior information. If you expect the true proportion to be different, adjust accordingly. Using 0.5 is conservative.
  • Result: Always round UP to the next whole number. This ensures you meet your desired precision.

Sample size: frequently asked questions

What is sample size calculation?

Sample size calculation determines how many observations you need to collect to estimate a population parameter (like a proportion) within a specified margin of error and confidence level. Larger samples provide narrower confidence intervals.

What does the estimated proportion represent?

The estimated proportion is your prior expectation of the population proportion. If you have no prior information, use 0.5 (50%), which maximizes the required sample size and provides a conservative estimate.

How do confidence level and margin of error affect sample size?

Higher confidence level requires larger sample size. Smaller margin of error requires larger sample size. The sample size is proportional to (z/E)^2, where z is the critical value and E is the margin of error.

What is the formula for sample size for a proportion?

n = z^2 * p * (1-p) / E^2, where z is the critical value, p is the estimated proportion, and E is the margin of error.

How does sample size relate to a smaller margin of error?

Sample size is inversely proportional to the square of the margin of error. Halving the margin of error requires 4 times the sample size.

Official sources

  • NIST/SEMATECH e-Handbook of Statistical Methods: NIST Handbook.
  • CDC guidance on survey design: NCHS.

Reviewed by the CalculatorHub team, edited by James Graham, 14 June 2026. See our methodology.