Calculate sample size

Estimate a simple-random-sample size for a population proportion and chosen margin of error.

freeworks offlinenothing uploaded
ToolSample Size Calculator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

The initial size is z²p(1−p) ÷ e², where e is absolute margin and z comes from the confidence level. A supplied finite population reduces it to n ÷ (1 + (n−1)/N), after which the result rounds upward.

  • Expected proportion begins at 0.5 because p(1−p) is largest there.
  • The initial 95% confidence choice still assumes simple random sampling and a suitable normal approximation.

Worked example

A general public survey
5% margin of error at 95% confidence, no assumption about the answer split
Input
											Margin of error percent: 5
Confidence level: 95
										
Output
												Sample size: 385
Z value: 1.96
Population proportion: 0.5
											

When to use this

Survey plans size respondent targets, quality audits choose defect samples, and prevalence studies compare the conservative 50% assumption with prior evidence.

Edge cases

  • Rare expected proportions can leave too few successes or failures for the normal approximation.
  • Clustered, stratified, weighted, or nonresponse-prone samples need design effects or other adjustments absent here.
  • A finite population correction reduces size only for a valid population count; it does not repair convenience sampling.

References