NumbarnNumbarn

Sample Size Calculator

Adjust the inputs below. Results update as you type.

How it works

For unknown population: n = z² × p(1−p) / e². For known population: adjust with finite correction. z=1.96 for 95% confidence; e=0.05 for ±5% margin. Use p=0.5 (maximum variance) when proportion is unknown. For a 95% confidence level with ±5% margin: n=385. Doubling precision (±2.5%) quadruples the required sample size. Non-response and sampling bias can invalidate statistically adequate samples.

Input guidance

  • Check units and decimal placement before running calculations.
  • For percentage and ratio tasks, define the baseline value clearly.
  • Use rounded output carefully and keep full precision for intermediate steps.

The formula

For a proportion, n = (Z² · p(1−p)) ÷ E², where Z is the confidence z-score, p the expected proportion, and E the margin of error. A finite population correction adjusts for small populations.

Worked example

For 95% confidence (Z=1.96), p=0.5, and a 5% margin: n = (1.96² × 0.25) ÷ 0.05² ≈ 385 respondents.

More examples to test

  • Baseline example: solve with clean numbers first to verify formula direction.
  • Edge-case example: test near-zero or boundary values to avoid interpretation errors.

How to interpret results

Use outputs as quick checks, then verify with step-by-step work for graded or high-stakes use.

When this can be inaccurate

Errors usually come from unit mismatch, wrong baseline assumptions, or rounding too early in multistep problems.

Change history

  • July 2026: Quality-reviewed for publication with formula checks and explanatory copy updates.

Site-wide corrections also appear on the corrections log.

Sponsored

Build math and logic skills with guided lessons

Educational platform recommendation.

Frequently asked questions

Why is sample size important?+

Too small a sample gives unreliable results with a wide margin of error; the right size balances precision against cost and effort.

What margin of error should I use?+

Commonly 5%. Smaller margins need much larger samples, since required size grows with the inverse square of the margin.

What if my population is small?+

Apply a finite population correction, which reduces the required sample when the population itself is not much larger than the sample.

Why do my classroom and calculator results differ?+

Differences usually come from rounding conventions, order-of-operations handling, or different baseline assumptions.

What is the safest way to validate an answer?+

Recompute with units shown and check against a second method or manual arithmetic for critical problems.

Related calculators