How can a poll of about 1,000 people speak for millions? The answer is sample size, the number of people you survey to estimate a result for a whole group. You do not need to ask everyone. With the right math, a well-chosen sample gives a close estimate. This guide shows how to calculate sample size step by step, explains each input, and works a real example.
To calculate sample size for a survey, use n = z^2 * p * (1 – p) / e^2. Here z comes from your confidence level, p is the expected proportion, and e is your margin of error. For 95% confidence (z = 1.96), p = 0.5, and a 5% margin, the math gives n = 385. Shrink the margin to 3% and you need about 1,068. Always round the sample size up.
The Sample Size Formula
The core formula for a survey sample size is short and reliable. In plain text, it looks like this:
n = z^2 * p * (1 – p) / e^2
Here n is the number of people you need to survey. The top of the fraction sets how sure you want to be and how much spread you expect. The bottom, e^2, sets how tight your estimate must be.
A smaller margin of error makes the bottom of the fraction tiny, so n grows fast. This version assumes a large population, and we adjust for small groups later.
Notice that the true population size does not appear here at all. That is why the same target settings give the same base sample whether you poll a city or a nation. Size only matters once your group is small, which is the special case we handle below.
What Each Input Means
The formula has just three inputs. Once you understand each one, the math is easy. Here is what they stand for:
- z (the z-score): This comes from your confidence level. Common values are 1.645 for 90%, 1.96 for 95%, and 2.576 for 99%. Higher confidence means a larger z and a larger sample. Learn more in our guide on what is a z-score.
- p (the population proportion): This is the share you expect to give a certain answer, written as a decimal. When you have no good guess, use 0.5. That value is the most conservative and produces the largest sample.
- e (the margin of error): This is how far your estimate may stray, like plus or minus 5%. Write it as a decimal, so 5% becomes 0.05. A smaller margin needs a much bigger sample.
Only e and z are true choices you set. The value p is a guess about the group, and using 0.5 removes the risk of guessing it wrong. That is why so many textbook examples start there.
The z-score is drawn from the normal curve, which measures spread. If you want the deeper idea of spread in raw data, see standard deviation explained.
A Worked Example
Say you survey a city about a simple yes or no question. You want 95% confidence and a 5% margin of error. You are unsure of the split, so use p = 0.5.
- Find z. For 95% confidence, z = 1.96.
- Square it. 1.96^2 = 3.8416.
- Multiply by p and (1 – p). 3.8416 * 0.5 * 0.5 = 0.9604.
- Square the margin. 0.05^2 = 0.0025.
- Divide. 0.9604 / 0.0025 = 384.16.
Round up to 385 people. You always round a sample size up, because a fraction of a person cannot be surveyed and rounding down would weaken your estimate.
Want a tighter 3% margin? Then 0.9604 / 0.03^2 = 0.9604 / 0.0009 = 1067.1, which rounds up to 1,068. A smaller margin of error costs many more responses.
What does the 385 actually promise? If 60% of your sample says yes, you can be 95% confident the true share sits between 55% and 65%. That is the margin of error at work. The larger sample simply narrows that range.
Adjusting for a Small Population
The basic formula assumes a very large group. When your population N is small, you can use the finite population correction to lower the count. The adjusted formula is:
n_adj = n / (1 + (n – 1) / N)
Suppose n = 385 from our example, and your whole group is only N = 2,000. Then n_adj = 385 / (1 + 384 / 2000) = 385 / 1.192 = 322.99, which rounds up to 323.
You save about 62 responses. The smaller your population, the bigger the savings. For a huge population, this correction barely changes the number, so many people skip it.
A simple rule helps: if your sample would be more than about 5% of the whole group, apply the correction. Below that share, the adjustment is so small it rarely matters, and the plain formula is fine to use.
Here is why the savings appear. In a small group, each person you survey covers a bigger slice of the whole. So you learn enough from fewer responses, and the correction trims the count to match. In a group of a few hundred, the drop can be large. In a group of millions, the same 385 barely moves, since your sample is a tiny fraction of everyone. The correction only rewards you when the population is genuinely limited.
Tips for Choosing Your Numbers
Picking good inputs keeps your survey both accurate and practical. Use these tips before you collect a single response:
- Set confidence first. 95% is the common standard. Use 99% only when errors are costly, since it raises the sample size.
- Use p = 0.5 when unsure. It gives the safest, largest sample and protects you if the true split surprises you.
- Match the margin to your stakes. A 5% margin fits most polls. Tighten it only when small differences truly matter.
- Round the sample up, never down. Rounding up keeps your margin of error at or below your target.
- Plan for non-response. If only some invitees reply, send more invitations so the final count still meets your target.
- Keep your sample random. The formula assumes every person has an equal chance of being picked. A biased sample can be wrong no matter how large it is.
These choices work together. Loosening the margin or lowering confidence shrinks the sample, while tighter goals raise it. Decide what your project truly needs before you commit to a number.
Once your responses are in, you will want to summarize them. Find the middle value of your data fast with our Median Calculator. It handles the sorting and counting so you can focus on reading your results.
Frequently Asked Questions About Sample Size
What Is the Basic Sample Size Formula?
The standard survey formula is n = z^2 * p * (1 – p) / e^2. In it, z comes from your confidence level, p is the expected proportion, and e is your margin of error. This version assumes a large population, and you round the result up to a whole number of people.
Why Is the Answer Often 385?
The number 385 comes from the most common settings: 95% confidence, p = 0.5, and a 5% margin. The math is 3.8416 * 0.25 / 0.0025 = 384.16, which rounds up to 385. Because those settings are typical, this figure appears in many polls and studies.
What Value Should I Use for p?
Use p = 0.5 when you have no reliable estimate of the true proportion. That value makes p * (1 – p) as large as possible, so it gives the biggest, safest sample. If solid past data suggests another value, like 0.3, you can use it and get a smaller sample.
How Does the Margin of Error Affect Sample Size?
The margin of error sits in the denominator as e^2, so shrinking it grows the sample fast. Cutting the margin from 5% to 2.5% roughly quadruples the required sample. That is why very tight margins can become expensive to survey for.
What Z-Score Goes With Each Confidence Level?
Common pairs are z = 1.645 for 90% confidence, z = 1.96 for 95%, and z = 2.576 for 99%. These come from the normal curve. Higher confidence uses a larger z, which raises the sample size you need.
When Should I Use the Finite Population Correction?
Use it when your population is small relative to your sample, such as a company of 2,000 people. The correction lowers the count using n_adj = n / (1 + (n – 1) / N). For very large populations the change is tiny, so it is usually skipped.
Why Do I Round the Sample Size Up?
You round up because you cannot survey a fraction of a person, and rounding down would push your margin of error above the target. Rounding 384.16 up to 385 keeps your estimate at least as accurate as planned. It is the safe direction to round.
Sources
Authoritative Sources Used in This Article
This article is for general education only, not professional statistical advice. Methods and notation can vary by field, course, or software, so follow your textbook or instructor for exact conventions. Reviewed for accuracy by Prof. Dr. Khalil Mudassar, PhD. Last updated September 11, 2026.
Author
Shakeel Muzaffar is the Founder and Editor-in-Chief of MultiCalculators.com, bringing over 15 years of experience in digital publishing, product strategy, and online tool development. He leads the platform's editorial vision, ensuring every calculator meets strict standards for accuracy, usability, and real-world value. Shakeel personally oversees content quality, formula verification workflows, and the platform's commitment to publishing tools that are genuinely useful for students, professionals, and everyday users worldwide.




