Calculators

Sample Size Calculator

Estimate the number of observations needed to estimate a population proportion at a chosen confidence level and margin of error, using a conservative proportion assumption and a finite-population correction.

Loading calculator...

What this Sample Size Calculator does

This Sample Size Calculator estimates how many observations are needed to estimate a population proportion within a chosen margin of error at a selected confidence level. It uses a familiar proportion-based model, then adjusts the initial estimate for a finite population. The result is an estimate of the number of completed observations to target. Since a sample cannot contain a fraction of a person or unit, round any decimal result up to the next whole number.

The calculation assumes that observations are selected at random, that the measured outcome can be represented as a proportion, and that responses are independent. The expected proportion describes the share of the population predicted to have a particular answer or characteristic. When that share is unknown, 50% is a conservative planning value because it produces the largest variance for a binary outcome and therefore tends to require a larger sample under this model.

This estimate does not automatically account for nonresponse, clustered or stratified sampling, unequal selection probabilities, or a complex survey design. It also does not determine whether a study question is well formed or whether its data will be reliable. Treat the output as a starting point for planning, with assumptions stated alongside the result.

How to use the Sample Size Calculator

Enter the population size, choose a confidence multiplier, set the margin of error, and provide an expected proportion. Use a population count that matches the group from which observations can realistically be drawn. The population might be eligible households in a defined area, registered users in a specified period, or items in a finite production batch.

  • Population size is the total number of eligible people or units in the defined group. The calculator accepts values from 1 to 1,000,000.
  • Confidence multiplier selects the z-score used for the calculation. The available options represent 90%, 95%, and 99% confidence.
  • Margin of error is the tolerated difference between the sample estimate and the population proportion, entered in percentage points. A 5-point margin means 0.05 in the formula.
  • Expected proportion is the anticipated percentage with the outcome of interest. Enter a value from 0% to 100%.

For example, suppose a survey concerns 10,000 eligible people, uses 95% confidence, allows a 5 percentage point margin of error, and has no prior estimate for the response share. Enter 10,000, choose 95%, enter 5, and use 50%. The unadjusted sample estimate is 1.96 squared multiplied by 0.5 and 0.5, divided by 0.05 squared, or about 384.16. Applying the finite-population adjustment gives 384.16 divided by (1 + 384.16 / 10,000), which is about 369.98. The calculator's sample-size result is therefore about 370, with a practical target of at least 370 completed observations.

How the Sample Size Calculator formula works

The calculation has two stages. First, it computes an initial sample size for estimating a proportion in a large population. In symbols, that initial value is the square of the confidence multiplier times p times (1 minus p), divided by the square of the margin of error. Here p is the expected proportion expressed as a decimal, and the margin is also converted from percentage points to a decimal.

The second stage applies a finite-population correction. The initial estimate is divided by one plus the initial estimate divided by the population size. When the population is very large relative to the initial estimate, this adjustment has little effect. When the population is small, it can reduce the required sample because a given number of observations covers a larger share of the group.

In this model, a higher confidence multiplier increases the estimate because the desired confidence interval must be wider for the same sample. A smaller margin of error also increases the sample size, and its effect is substantial because the margin is squared in the denominator. For a given confidence and margin, p near 50% generally yields the largest initial estimate. Values near either endpoint imply less variation in a binary outcome, but an assumed proportion should reflect a defensible prior estimate when one exists.

Use cases for the Sample Size Calculator

A proportion-based sample-size estimate is useful during early planning for surveys, audits, and quality checks. For instance, a city team could estimate the number of randomly selected households needed to assess the share using a service. A researcher could plan a questionnaire about the proportion of respondents choosing one option. A production analyst could estimate a sample for checking the share of units with a particular attribute, provided the sampling assumptions fit the process.

In applied mathematics and statistics, making assumptions explicit is part of the calculation. Record the population definition, confidence choice, margin, and expected proportion with the result. This allows another analyst to reproduce the estimate and see what tradeoffs shaped the sample target. It also makes it easier to compare scenarios, such as the effect of a narrower margin or a different prior proportion.

The estimate concerns precision for one population proportion. It is not a universal sample size for every study. A project measuring a mean, comparing several groups, estimating rare events, or fitting a predictive model may require a different method. Study design and analysis goals should determine which model is appropriate.

Other factors to consider when calculating a sample size

The calculator describes a simple random sample with independent observations. If people are sampled in groups, such as schools or neighborhoods, responses within each group may resemble one another. That dependence can make the effective information smaller than the raw count suggests. Likewise, unequal selection chances, weighting, or a multistage design may require a design effect or a specialist calculation.

Plan for incomplete responses separately. If the target is 370 completed observations and some selected people are expected not to respond, the number invited may need to be larger. The required adjustment depends on a credible response-rate estimate. It is useful to keep the completed-sample target distinct from the number of invitations, since the latter is an operational planning figure.

Consider how the outcome is measured, how the population list was built, and whether the survey instrument can produce consistent answers. A large sample cannot correct ambiguous questions, systematic coverage gaps, or biased selection. Review ethical and practical constraints too, including respondent burden and data handling. For consequential research, have the sampling plan reviewed by a qualified statistician before data collection.

Frequently asked questions

What does the confidence level mean?

The confidence level describes the long-run coverage of the interval procedure under the model's assumptions. A 95% setting uses a z-score of 1.96. It does not mean there is a 95% probability that a fixed population value lies inside one already calculated interval.

Why is 50% a common expected proportion?

For a yes-or-no outcome, the variance is largest when the expected proportion is 50%. If there is no reliable prior information, that choice is conservative for this formula. A credible estimate from earlier data can be entered instead.

Why does a smaller margin of error need more observations?

A smaller margin asks the estimate to be more precise. Because the margin is squared in the denominator, reducing it can raise the required sample considerably. Compare targets before choosing a precision level that the project can support.

Does the result include people who do not respond?

No. It estimates completed observations under the stated model. To plan invitations, use a separate expected response rate and account for it explicitly.

Can I use this for a study comparing two groups?

This formula estimates one population proportion. Comparing groups may require a calculation based on the difference to detect, group allocation, outcome variation, and statistical power. Use a method designed for that study question and document its assumptions.

Written by

c-double.com Editorial Team

Editorial team

c-double.com publishes practical how-to guides and educational articles with clear steps and useful context.