AbraCalc

Sample Size Calculator

Calculate the required sample size for estimating a population proportion.

Embed this tool on your site

How to use this tool

  1. Enter expected proportion (p), z* (confidence level) and margin of error (e) in the fields above.
  2. Results update instantly as you type — or click Calculate.
  3. Read your required sample size (n) and the full breakdown beneath it.

Calculate the minimum sample size needed: n = (z*² × p × (1−p)) / e². Always round up to the next whole number.

Formula

Required sample size: n = ⌈ (z2 × p × (1 − p)) / e2

Where z is the critical value for the chosen confidence level, p is the expected proportion, and e is the desired margin of error. The result is rounded up to the nearest whole number.

How it works

This calculator uses the standard formula for estimating a population proportion, computing the minimum number of survey respondents needed so that the margin of error does not exceed the specified value at the chosen confidence level.

The formula assumes simple random sampling, an infinite (or very large) population, and that the true proportion is approximately p. When the population is small, a finite-population correction should be applied separately.

Worked example

Worked example

  1. Inputs: expected proportion p = 0.5, confidence level z* = 1.96 (95%), margin of error e = 0.05.
  2. Compute the numerator: z² × p × (1 − p) = 1.96² × 0.5 × 0.5 = 3.8416 × 0.25 = 0.9604.
  3. Compute the denominator: e² = 0.05² = 0.0025.
  4. Divide: 0.9604 ÷ 0.0025 = 384.16.
  5. Round up to the nearest whole number: ⌈384.16⌉ = 385.

Required sample size n = 385

Key terms

Margin of error (e)
The maximum acceptable difference between the sample estimate and the true population value, expressed as a proportion (e.g., 0.05 for ±5%).
Confidence level
The probability that the true population proportion falls within the margin of error. Common levels are 90%, 95%, and 99%, corresponding to z* values of 1.645, 1.96, and 2.576.
Z* (critical value)
The number of standard deviations from the mean that corresponds to the chosen confidence level in a standard normal distribution.
Population proportion (p)
The expected fraction of the population that holds a given characteristic. Using p = 0.5 yields the most conservative (largest) sample size estimate.
Simple random sampling
A sampling method where every member of the population has an equal chance of being selected, which is the assumption underlying this formula.

Frequently asked questions

Why use p = 0.5 when the proportion is unknown?
p × (1−p) is maximised at p = 0.5, giving the most conservative (largest) required sample size. If you have a prior estimate of p, use it to get a smaller required n.

References & sources