SOLVETUTORMATH SOLVER

Instrument MI-07-163 · Statistics

Sample Size Calculator

Before you collect data, this answers the planning question: how many observations do you actually need to pin your estimate down to a chosen margin of error?

Instrument MI-07-163
Sheet 1 OF 1
Rev A
Verified
Type 07 — Inferential Statistics SER. 2026-07163

Required sample size

97

n = ceil( (z x s / E)^2 )

The working Every figure verified twice
  1. n = ceil((1.96·15 ⁄ 3)^2) = 97
Worksheet log
  1. No entries yet — change an input to log a scenario.

How this instrument works

Sample size planning flips the margin-of-error question around. Instead of starting from a sample you've already collected and asking how wide its confidence interval is, you start from a margin of error you're willing to accept and ask how large a sample you need to collect to guarantee it, at a chosen confidence level. That makes this instrument a planning tool used before data collection, not an analysis tool used after it.

The formula is literally the margin of error formula solved for n instead of ME: n = ceil((z x s / E)^2). Because n sits inside a square, small changes in your target margin of error (E) swing the required sample size dramatically — halving E doesn't double the required n, it roughly quadruples it. The result is always rounded up to the next whole number (the ceiling), because a sample of 96.04 people isn't obtainable; you need the full 97th observation to guarantee your target precision.

The standard deviation (s) you plug in has to be an estimate, since you haven't collected the sample yet — researchers typically pull it from a pilot study, a previous similar study, or a conservative guess. That's the practical catch of sample-size planning: the formula needs the very number (variability) that the study itself is meant to help estimate, so an inaccurate guess for s produces a required sample size that may turn out too small, or unnecessarily large, once real data comes in.

n=(zsE)2n = \left\lceil \left(\frac{z \cdot s}{E}\right)^2 \right\rceil
n — required sample size, rounded up to the next whole number · z — critical value for the chosen confidence level · s — estimated standard deviation · E — desired margin of error. Solving this same formula for E instead gives the margin-of-error formula this site's other instrument computes.
  • Pick your target Confidence level — higher confidence (99%) demands a larger sample than lower confidence (80%) for the same precision.
  • Enter your best estimate of variability into Estimated standard deviation (s) — from a pilot study, prior research, or a conservative guess.
  • Enter how tight you need the estimate into Desired margin of error (E) — a smaller E requires a larger sample.
  • Read Required sample size — the instrument rounds up to the next whole observation automatically.
  • This is the inverse of this site's margin of error instrument: that one starts from a sample and reports its margin of error; this one starts from a target margin of error and reports the sample you'd need.

Worked example — 95% confidence, s = 15, E = 3

Select 95% (z = 1.96) from Confidence level, enter 15 into Estimated standard deviation (s), and enter 3 into Desired margin of error (E). The instrument computes (1.96 x 15 / 3)^2 = (1.96 x 5)^2 = 9.8^2 = 96.04, then rounds up: Required sample size reads 97.

That 97 is the smallest whole sample that guarantees a margin of error of 3 or better at 95% confidence, given an estimated standard deviation of 15. Rounding down to 96 would technically fall short of the target — 96.04 needs the full 97th observation, which is exactly why the formula always rounds up rather than to the nearest whole number.

Questions

Why does the result round up instead of to the nearest whole number?

Because rounding to the nearest whole number could round down and leave you short of your target precision. In the worked example, (1.96 x 15/3)^2 = 96.04 — rounding to the nearest whole number would give 96, a sample just barely too small to guarantee the requested margin of error. Rounding up (the ceiling function) to 97 guarantees you meet or beat the target every time.

How much does tightening my target margin of error increase the required sample size?

Because E is squared in the denominator, cutting your target margin of error in half roughly quadruples the required sample size. In the worked example, tightening E from 3 to 1.5 with the same s and z pushes the required n from 97 up to about 385 — a fourfold jump for a twofold precision gain, which is why very tight margins of error get expensive to collect fast.

Where does the standard deviation (s) come from if I haven't collected data yet?

From the best available estimate: a small pilot study, a similar prior study on the same population, or, in the absence of either, a conservative (deliberately larger) guess. Because s is squared in the formula, overestimating it inflates the required sample size, while underestimating it risks landing on a sample too small to hit your actual target once real data comes in.

How is this different from the margin of error calculator?

They share the same formula solved for different variables. The margin of error instrument starts with a sample you've already collected (s and n) and tells you how wide its confidence interval is. This instrument starts with a target margin of error you want to achieve and tells you the sample size (n) you'd need to collect to get there.

Does this formula work for planning a sample size for a proportion, like a poll?

Not directly — this version uses a standard deviation (s) appropriate for a numeric mean. Sample-size planning for a proportion, like an expected 'yes' percentage, uses a related but different formula built on p-hat(1-p-hat) instead of s^2; see this site's p-hat and sampling error instruments for the proportion-based building blocks that formula needs.

References