Sample Size Calculator (Survey, Margin of Error & Power)

This free sample size calculator tells you how many people to survey or test. Set a margin of error, confidence level and (optionally) your population size to get the survey sample size with the finite population correction, design effect and response-rate adjustment. It also finds the sample size for estimating a mean, works backwards to the margin of error from a sample size, and runs a power analysis for comparing two means (exact t-test power) or two proportions (A/B tests). Every answer shows step-by-step working, and the survey modes include TI-84 keystrokes.

Contents

How to Use the Sample Size Calculator

  1. Pick your goal. Survey / proportion for percentages (polls, satisfaction, yes/no questions), Estimate a mean for averages, Margin of error from n if you already know your sample size, or one of the two power tabs to compare groups.
  2. Set the precision. Choose a confidence level (tap 90%, 95% or 99%) and the margin of error you can accept, for example ±5%.
  3. Add what you know. Leave the expected proportion at 50% if you have no idea (it gives the safest, largest sample). Enter a population size only when your population is small and known, such as 800 employees.
  4. Read the answer. The sample size updates as you type, with the formula steps, a table for other margins and confidence levels, and how the answer changes with population size. Copy share link saves your inputs in the URL.

Sample Size Formula (Cochran) for Surveys

For a survey that estimates a percentage, the standard formula is Cochran’s:

n₀ = z² · p(1 − p) / E²

  • z is the critical value for your confidence level (1.96 for 95%).
  • p is the expected proportion as a decimal. If you don’t know it, use 0.5. That makes p(1 − p) = 0.25, its largest value, so the sample is big enough whatever the true answer is.
  • E is the margin of error as a decimal (±5% → 0.05).

Worked example: 95% confidence, ±5% margin, p = 0.5: n₀ = 1.95996² × 0.5 × 0.5 / 0.05² = 384.15. Always round up, so you need 385 completed responses. That is the familiar “385” you see on most survey calculators.

For cluster or stratified samples, multiply n₀ by the design effect (DEFF, often 1.5–2). To find how many invitations to send, divide the sample size by the expected response rate: 385 responses at a 30% response rate means about 1,284 invitations.

Finite Population Correction: Does Population Size Matter?

When your population is small, and the sample would be a noticeable share of it, apply the finite population correction (FPC):

n = n₀ / (1 + (n₀ − 1) / N)

Worked example: a company with N = 800 employees, 95% confidence, ±5%: n = 384.15 / (1 + 383.15 / 800) = 259.75 → 260 responses. With a 30% response rate, invite 867 people.

Population N1005001,0005,00010,000100,000Very large
Sample n (95%, ±5%)80218278357370383385

Population size barely matters once it is in the tens of thousands, which is why a national poll and a city poll both need about 1,000 people for ±3%.

Sample Size Table by Margin of Error and Confidence Level

Sample sizes for a large population with p = 50% (worst case), rounded up:

Margin of error90% confidence95% confidence99% confidence
±1%6,7649,60416,588
±2%1,6912,4014,147
±3%7521,0681,844
±4%4236011,037
±5%271385664
±10%6897166

Halving the margin of error needs about four times the sample, because n grows with 1/E².

Z-Values for Common Confidence Levels

Confidence level80%85%90%95%98%99%99.9%
z (two-sided)1.28161.43951.64491.96002.32632.57583.2905

z = invNorm(1 − α/2), where α = 1 − confidence. You can get any of these on a TI-84 with invNorm(; see the steps below or use our normal distribution calculator.

Sample Size for Estimating a Mean

n₀ = (z · σ / E)²

σ is the population standard deviation (take it from a pilot study or past data; a rough guess is range ÷ 4). E is the margin of error in the same units.

Worked example: estimate average commute time within ±2 minutes at 95% confidence with σ = 12 minutes: n₀ = (1.96 × 12 / 2)² = 138.29 → 139. Because you’ll estimate σ with the sample SD and use a t-interval, the calculator also gives a t-adjusted n (141 here), the smallest n where tn−1 · σ/√n ≤ E. Use it for small samples. Need the interval afterwards? Use our confidence interval calculator.

Margin of Error from a Sample Size

E = z · √(p(1 − p) / n) · √((N − n)/(N − 1))

The last factor is the FPC; leave it out for a large population. Example: 1,000 respondents, 95% confidence, p = 0.5: E = 1.96 × √(0.25/1000) = 0.0310 → ±3.1%. For 400 respondents out of a population of 2,000, E = ±4.4%.

Power Analysis: Sample Size for Comparing Two Means

To compare two groups with a test, precision isn’t enough. You also need power (1 − β), the chance of detecting a real difference. For a two-sample t-test with equal groups:

n per group ≈ 2 (z1−α/2 + z1−β)² / d², with Cohen’s d = Δ / σ

Worked example: detect a 5-point difference with σ = 10 (d = 0.5), α = 0.05 two-sided, 80% power. The normal formula gives 62.8 → 63. The calculator then solves the exact noncentral t power (the same method as G*Power and Python statsmodels) and gives 64 per group, 128 in total. At 90% power you need 86 per group. Unequal groups (allocation ratio) and expected dropout are supported. After you collect the data, analyse it with our hypothesis test calculator.

Effect size d0.2 (small)0.5 (medium)0.8 (large)
n per group (α = 0.05, 80% power)3946426

Sample Size for Two Proportions (A/B Test)

n₁ = [zα√(p̄q̄(1 + 1/k)) + zβ√(p₁q₁ + p₂q₂/k)]² / (p₁ − p₂)²

Here p̄ = (p₁ + k·p₂)/(1 + k), q = 1 − p, and k = n₂/n₁ (1 for equal groups). Example A/B test: baseline conversion 10%, hoping for 12% (a 20% relative lift), α = 0.05 two-sided, 80% power → 3,841 visitors per variant (7,682 in total). The results also show Cohen’s h method (3,835), the unpooled formula (3,839) and the Fleiss continuity-corrected value (3,941), so you can match whichever method your team or textbook uses. Analyse the finished test with our chi-square calculator.

How to Calculate Sample Size on a TI-84

The TI-84 has no sample size command, but it does the arithmetic in three lines:

  1. Press 2nd VARS (DISTR), choose 3:invNorm(, type 0.975 for 95% confidence, then press STO→ ALPHA MATH (Z) and ENTER. The screen shows 1.959963985.
  2. Type Z²*0.5*0.5/0.05² and press ENTER. The result is 384.1458821.
  3. For a finite population type Ans/(1+(Ans−1)/800) and press ENTER (259.7454…). Round up to 260.

For margin of error, run STAT → TESTS → A:1-PropZInt; the margin is half the interval width. Try it on our TI-84 Plus CE calculator online.

Why This Sample Size Calculator Is Different

  • Five calculators in one: survey proportion, mean, margin of error from n, two-mean power and two-proportion (A/B) power. Most survey calculators (SurveyMonkey, Qualtrics, Raosoft) stop at the first one.
  • Exact t-test power using the noncentral t distribution, not only the z shortcut, so the answers match G*Power and statsmodels.
  • Design effect, response rate, dropout and unequal group sizes are built in.
  • Exact z-values (1.959964, not a rounded 1.96), a live table across margins and confidence levels, a population-size table, a power curve, step-by-step working and TI-84 keystrokes.
  • Tested against SciPy and statsmodels on more than 3,000 values.

Sample Size Calculator FAQ

For a large population at 95% confidence and ±5% margin of error you need 385 completed responses. For ±3% you need 1,068 and for ±10% you need 97. Smaller known populations need fewer once you apply the finite population correction.

385 comes from Cochran’s formula with the most common settings: 1.96² × 0.5 × 0.5 / 0.05² = 384.15, rounded up. It assumes 95% confidence, a ±5% margin of error, p = 50% and a large population.

Only when the population is small. Above roughly 20,000 people the required sample hardly changes (385 vs 383 for 100,000). For 1,000 people you need 278, and for 100 people you need 80.

Use 50%. It maximises p(1 − p), so your sample is large enough whatever the real answer turns out to be. If past data says the answer is near 10% or 90%, using that value lowers the sample size.

±5% is the usual choice for business and academic surveys, while ±3% is common for political polls. Use ±10% only for rough, exploratory work. Each halving of the margin needs about four times as many responses.

Power is the probability that your test detects a real effect of the size you specified. 80% is a widely used minimum (a 20% chance of missing a real effect), and 90% is common in clinical trials. Higher power needs a larger sample.

It depends on your baseline rate and the lift you want to detect. To detect a change from 10% to 12% with α = 0.05 and 80% power, you need about 3,841 visitors per variant. Smaller lifts need many more visitors, because n grows with 1/(p₁ − p₂)².

The z formula is the standard textbook answer. If you will estimate σ from the sample, the t-adjusted n from this calculator is slightly larger and safer, which matters most for samples under about 30.

Ti84CalcPro is not affiliated with or endorsed by Texas Instruments. TI-84 Plus CE is a trademark of Texas Instruments.