Sample size calculator

Work out how many respondents, plots, or units you need - for a single estimate, a comparison between two groups, or a stratified survey. Every result shows the working and the formula used.

One groupEstimate a single value
Compare two groupsDetect a difference
Stratified sampleKnown subgroups
Use this when you want to estimate one number for a population - e.g. "what proportion of farmers have adopted a new variety?" or "what is the average yield per hectare?" - within a chosen margin of error.
What are you estimating?
Expected proportion (p)
0.50
Your best guess of how common the thing you're measuring is in the population - not the size of any subgroup. If you have no prior data, leave it at 0.50; this is the most conservative choice and gives the largest (safest) sample size. If a pilot study or earlier research suggests, say, 30%, enter 0.30 instead - it will usually reduce the required sample.
Margin of error (E)
5%
How much error either side of the true value you're willing to accept. A 5% margin means your result could differ from the true population value by up to 5 percentage points, in either direction. Smaller margin = larger required sample.
Confidence level
How sure you want to be that the true population value falls within your margin of error, across repeated samples. 95% is the conventional default for most field and social-science research.
Population size (N) - optional, but important if your population is small
The total number of units that actually exist - e.g. total farmers, plots, or animals in the area you're studying. If this number is large or unknown, leave it blank. A practical guideline: finite population correction is usually negligible once your sample is below about 5% of N - below that sampling fraction, leaving N blank makes little practical difference. As N gets smaller relative to your required sample, the correction reduces the required sample more noticeably, since you cannot sample more units than exist.
Advanced adjustments - optional, both default to "none"
These inflate your final sample for real-world survey conditions. Apply after deciding your core statistical design.
Design effect (DEFF) - for cluster/multistage sampling
Expected non-response rate (%)
Required sample size
-

Step by step

Theory: estimating a single value

For a proportion, the base sample size assuming an infinite population is:

n₀ = Z² × p × (1 − p) / E²

For a mean, the equivalent formula is:

n₀ = Z² × σ² / E²

If the population size N is finite and known, a finite population correction (FPC) is applied, since you cannot sample more units than exist. As a rule of thumb, FPC is usually negligible once the sampling fraction (n₀/N) is below about 5%, but the calculator applies it exactly regardless:

n_fpc = n₀ / [1 + (n₀ − 1) / N]

If using cluster or multistage sampling, a design effect (DEFF) inflates the sample to account for intra-cluster correlation:

n_deff = n_fpc × DEFF

Finally, an anticipated non-response rate r inflates the sample so that the achieved (responding) sample still meets target precision:

n_final = n_deff / (1 − r)
  • Z - the standard normal value for your chosen confidence level (e.g. 1.96 for 95%)
  • p - expected proportion with the characteristic of interest (0.5 is most conservative)
  • σ - expected standard deviation of the variable, for means
  • E - acceptable margin of error, as a decimal for proportions or in raw units for means
  • N - total population size, if known and finite
  • DEFF - design effect; 1 for simple random sampling, >1 for cluster/multistage designs (often estimated from a pilot or similar prior study)
  • r - anticipated proportion of sampled units who will not respond
References: Cochran, W.G. (1977). Sampling Techniques (3rd ed.). New York: John Wiley & Sons. Kish, L. (1965). Survey Sampling. New York: John Wiley & Sons (design effect).