Sample Size CalculatorFree online math calculator — instant results, no sign-up

Sample size for a survey at a confidence level.

Inputs

%
%
Sample size
385

Sign in to save results and favorites.

About the Sample Size Calculator

This calculator determines the minimum number of survey respondents required to achieve a statistically valid result at a chosen confidence level. Researchers, pollsters, and businesses use it to plan sample sizes for surveys, market research, and quality inspections without surveying more people than necessary.

Confidence
The probability that the true population value falls within the margin of error; choose 90% (Z = 1.645), 95% (Z = 1.96), or 99% (Z = 2.576).
Margin of error
The maximum expected difference between the sample result and the true population value, entered as a percentage (typically between 1% and 10%).
Population proportion
The assumed proportion of the population that holds the attribute of interest, entered as a percentage (50% provides the most conservative, maximum sample size estimate).
Population size (0 = unlimited)
The total number of individuals in the target population; enter 0 if the population is unknown or effectively infinite.

Formula and method

s0 = (Z^2 × p × (1 - p)) / e^2
n = ceil(s0 / (1 + (s0 - 1) / N)) if N > 0, else ceil(s0)
  • ZCritical standard score corresponding to the selected confidence level (1.645 for 90%, 1.96 for 95%, 2.576 for 99%)
  • pEstimated population proportion expressed as a decimal (e.g., 0.50 for 50%)
  • eMargin of error expressed as a decimal (e.g., 0.05 for 5%)
  • NTotal population size
  • s0Unadjusted sample size for an infinite population (Cochran's formula)
  • nRequired sample size rounded up to the nearest whole integer

The tool first calculates the baseline sample size for an infinite population using Cochran's formula based on the Z-score, expected proportion, and margin of error. If a positive population size is provided, it applies the finite population correction factor to adjust the count downward. The final value is always rounded up to the next whole integer using the ceiling function to ensure the target margin of error is met.

Worked example

These are the calculator's starting values and the results it actually produces for them.

Inputs

  • Confidence95%
  • Margin of error5 %
  • Population proportion50 %
  • Population size (0 = unlimited)0

Results

  • Sample size385

How to use the Sample Size Calculator

  1. 1Convert the margin of error and population proportion percentages into decimals, and retrieve the critical Z-score for the selected confidence level.
  2. 2Calculate the unadjusted sample size: s0 = (Z^2 × p × (1 - p)) / e^2.
  3. 3If population size N is greater than 0, adjust using the finite population correction: s = s0 / (1 + (s0 - 1) / N); otherwise, keep s = s0.
  4. 4Round the result up to the nearest whole integer using the ceiling function to obtain the required number of respondents.

Reading your result

The result indicates the minimum number of completed responses needed to estimate the true population parameter within your specified margin of error. For example, a sample size of 385 at a 95% confidence level and 5% margin of error means that if you repeated the survey 100 times, the results would reflect the actual population within ±5 percentage points in 95 of those surveys.

Limitations

This calculation assumes simple random sampling and does not account for design effects seen in stratified or cluster sampling. It also assumes a 100% response rate, meaning you must invite more participants if non-response or survey drop-off is expected.

Common questions

Why is 50% the standard default for population proportion?+

A 50% proportion represents maximum variance (p × (1 - p) = 0.25). Setting p to 50% yields the largest required sample size, guaranteeing adequate statistical power regardless of the actual survey outcome.

When should I enter a population size instead of leaving it at 0?+

Enter a population size when surveying a known, relatively small group (such as employees in an organization or members of an association). For very large populations (e.g., hundreds of thousands or millions), the finite correction has minimal effect on the required sample size.

How does lowering the margin of error affect the sample size?+

Because the margin of error is squared in the denominator, cutting the margin of error in half (such as from 5% to 2.5%) roughly quadruples the required sample size.

Does the calculator save my information?+

Calculations run in your browser. While signed in, inputs and results are automatically recorded in account history; saving a result creates a separate saved record.

Further reading

You might also like

Results are estimates for informational purposes and are not financial, medical or legal advice.