Home/Calculators/Statistics/Sample Size Calculator

Sample Size Calculator

Find the sample size you need for a survey at a given margin of error, instant and free.

sample-size-calculator
Result
—
In summary: The required sample size is z² × p(1 − p) ÷ e². With z = 1.96, p = 0.5 and e = 0.05, that is 3.8416 × 0.25 ÷ 0.0025 = 384.16, which rounds up to 385 respondents.

How to calculate sample size

The sample size needed for a proportion is n = z² × p(1 − p) ÷ e², rounded up to a whole respondent. With z = 1.96 (95%), p = 0.5 and a margin of error e = 0.05, that is 3.8416 × 0.25 ÷ 0.0025 = 384.16, which rounds up to 385. For a numeric outcome you need an estimate of the spread first, which is where the standard deviation calculator comes in.

How to use this calculator

Enter the z-score for your confidence level, your expected proportion (use 0.5 if unsure), and your target margin of error as a decimal. The result is always rounded up so the margin is met. To check the margin a sample actually gives, use the margin of error calculator.

Choosing your inputs

Use p = 0.5 for the safest (largest) sample size when the true proportion is unknown. A smaller margin of error or a higher confidence level both increase the sample needed. To build the final estimate, see the confidence interval calculator.

Frequently asked questions

How do I calculate sample size?
Use n = z² × p(1 − p) ÷ e², then round up. With z = 1.96, p = 0.5, e = 0.05 you need 385 respondents.
Why round up?
You can't survey a fraction of a person, and rounding up guarantees the margin of error is met.
What proportion should I assume?
If you don't know it, use 0.5, which gives the largest and safest sample size.
How do I get a smaller margin of error?
Lower the target margin e, which increases the required sample size sharply because it depends on 1 ÷ e².
Do I need a bigger sample for a bigger population?
Barely — the formula does not include population size at all, so polling a city and polling a country need almost the same sample. A finite population correction only makes a real difference when your sample would exceed roughly 5% of the population.
How this tool works

The formula behind this tool is written out in full in the sections above, so you can check the maths yourself. Every calculator on Calculorium is verified against worked examples with automated tests before it is published, and pages are reviewed as formulas or standards change. Nothing you type is sent anywhere — the calculation runs entirely in your browser. Read how we build and check these tools.

Last updated: July 27, 2026 · Calculations run in your browser. Estimates for information only.