DataToolsLab
Statistics & Probability Calculators

Sample Size Calculator

Find the sample size needed for a target margin of error and confidence level.

Loading tool…

What is Sample Size?

Planning a study runs the margin-of-error formula backwards: n = (z* × σ ÷ E)². It answers how many observations are needed before the data is collected, which is a very different question from analysing data already in hand.

How it works

The large-sample z value is used because the sample size is not yet known, and the exact result is always rounded up — a required n of 166.7 has to be 167 people, and rounding down would quietly miss the target margin. Both the exact and rounded values are shown so the rounding is visible.

  1. Enter your input. Type or paste your input into the field above — the tool responds instantly.
  2. Review the result. Output updates live as you type. Everything runs entirely in your browser.
  3. Copy or download. Use the Copy button to grab the result, or Download to save it as a file.

Examples

Realistic sample

Type or paste any realistic input — the tool computes the result locally and instantly.

Common mistakes

Expecting a server round-trip

Nothing is uploaded — every tool in this category runs entirely in your browser.

Online