The Handy Calculators logoTheHandyCalculators.com

    Sample Size Calculator

    Required sample size to estimate a proportion or mean at a chosen confidence level and margin of error.

    Autosave on
    Required sample size (n)
    385
    z critical value
    1.9600

    n = z²·p̂(1−p̂) / E² = 1.960²·0.5·0.500 / 0.05² ≈ 384.1

    How many respondents, customers, or measurements do you need? This calculator returns the minimum sample size required to estimate a population proportion or mean within a target margin of error at a chosen confidence level — and applies the finite-population correction when you know N.

    The formulas

    Proportion: n = z² · p̂ · (1 − p̂) / E². p̂ is your best guess of the true proportion (use 0.5 for the most conservative — largest required n). E is the half-width of the confidence interval you'll accept.

    Mean: n = (z · σ / E)². σ is the population standard deviation (use a pilot study or domain knowledge to estimate). E is the half-width of the interval on the mean.

    Finite-population correction (proportions): n_adj = n / (1 + (n − 1)/N) where N is the population size. Drops n meaningfully when n approaches N.

    Worked example — survey design

    You want to estimate the proportion of voters supporting a candidate within ±3 percentage points, at 95% confidence.

    z = 1.96, E = 0.03, p̂ = 0.5 (worst case).

    n = 1.96² · 0.5 · 0.5 / 0.03² = 3.8416 · 0.25 / 0.0009 ≈ 1067.

    Halve the margin to ±1.5 pp and n quadruples to ≈ 4269. Precision is expensive.

    Worked example — quality control

    Estimate the mean weight of bagged chips to within ±2 g at 99% confidence. Historical σ = 8 g.

    z = 2.576, n = (2.576 · 8 / 2)² = 10.304² ≈ 106.

    If σ is unknown, the formula uses z; the actual study then uses t. For n > 30 the difference is small; for smaller pilot runs, inflate by ~10–15% as a safety margin.

    How precision and confidence interact

    Quadrupling confidence width has no fixed cost; doubling precision (halving E) always quadruples n.

    Margin of error scales as 1/√n. Going from n = 400 to n = 1600 halves the margin.

    If the true p̂ is close to 0 or 1, the required n is smaller than the p̂ = 0.5 worst case — but unless you're confident about p̂, use 0.5 to be safe.

    Common pitfalls

    Ignoring non-response. If 60% of contacted respondents reply, you need to contact 1067 / 0.6 ≈ 1779 people to land 1067 responses.

    Stratified or clustered designs need a design effect (DEFF) multiplier, often 1.2–2.0, on top of the simple-random-sample n.

    Multiple subgroup estimates each need their own n. A national poll with N = 1067 can have ±3pp overall but ±10pp for a 100-person subgroup.

    Forgetting the FPC when N is small relative to n. Sampling 400 of 1000 needs only n_adj ≈ 286.

    Frequently asked questions

    Why use p̂ = 0.5 by default?

    Because p̂(1−p̂) peaks at 0.25 when p̂ = 0.5 — that's the largest possible n you'd need, so you're guaranteed enough precision regardless of the true proportion.

    Margin of error in percentage points vs percent?

    ±3 percentage points means the interval has half-width 0.03 in proportion units. Don't enter 3 — enter 0.03.

    How do I plan for hypothesis testing instead?

    That uses POWER analysis — you specify the effect size you want to detect, α, and 1 − β (power). Different formula. We can add a power calculator on request.

    Does this account for design effect?

    No — it's the simple-random-sample formula. Multiply by your DEFF if you have a clustered design.

    By Larius software engineer, NC real estate broker & CRE/business appraiserReviewed by the Handy Calculators editorial teamHow we build calculators

    More in Statistics & Probability

    From z-scores and confidence intervals to t-tests, chi-square, correlation, regression, and the binomial/Poisson distributions — textbook-grade tools with worked examples.

    See hub →
    Browse all Education →