Sample Size Calculator: How Many to Survey for a Mean or a Proportion, and for Comparing Two Groups

Work out how big a sample you need.

Calculated from standard textbook formulas, with every step shown. The formulas are fixed, so the working does not need checking: what matters is the numbers you type in. Use these calculators only if you are competent to choose the inputs (loads, material strength, dimensions, supports) and check your units and assumptions. For learning and checking your own working: design and sign-off are for a qualified engineer. Drafting Central does not store the numbers you type.

How this calculator works

Choose to estimate a mean, a proportion, or to compare two means or two proportions.

Enter the confidence level and the margin of error, or the power and the difference you want to detect.

The calculator gives the sample size rounded up, with the critical values and the working.

Formulas used

  • n = \left(\frac{z\sigma}{E}\right)^2
  • n = \frac{z^2p(1 - p)}{E^2}
  • n = \frac{2(z_{\alpha/2} + z_\beta)^2\sigma^2}{\Delta^2}
  • n = \frac{n_0}{1 + (n_0 - 1)/N}

Worked example

With the default numbers in the calculator above:

  1. Critical z value for the confidence level (two-sided): 1.96
  2. Sample size before rounding: 96.0365
  3. Required sample size (rounded up): 97 (from 96.0365 before rounding up)

Change the numbers in the calculator to see the full working, every step, for your own case.

A second worked example

A different case, with these numbers: What do you want? Estimate a proportion.

  1. Critical z value for the confidence level (two-sided): 1.96
  2. Sample size before rounding: 384.146
  3. Required sample size (rounded up): 385 (from 384.146 before rounding up)

Common questions

How big a sample do I need for a survey?

For a proportion with a margin of error of 5 percent at 95 percent confidence, about 385 people, whatever the size of a large population.

What is statistical power?

The chance that a study finds a difference when there really is one. 80 percent is the usual target.

Why use 50 percent if I do not know the proportion?

It gives the largest possible sample size, so the study will be big enough whatever the true value is.

Related calculators

Got a question about this? Ask an engineering question and get a plain-language answer with references.

Further reading: Any statistics text (sample size and power).

Need a calculator we do not have?

Tell us what you would like to calculate. We read every request and build the most asked-for ones.

We store your request (and your email if you give it) to decide what to build. We do not store the numbers you type into calculators.

Embed this calculator on your own page

Copy this code into your page. The calculator runs inside the frame and links back to Drafting Central.

Need this drawn, designed or checked?

Drafting Central is a mechanical engineering and drafting business working with customers across Australia and around the world. A calculator gives you the numbers; we can turn them into drawings and designs.

Need help with a real project?

Talk to Drafting Central →

← All engineering calculators