Frequently Asked Questions
Why is 385 the classic survey sample size for a ±5% margin of error?
At 95% confidence (Z = 1.96) and maximum variance (p = 0.5), Cochran’s formula gives 1.96² × 0.25 ÷ 0.05² = 384.16, which rounds up to 385 participants.
Why does the sample size change when I change the success probability?
The p box feeds both the binomial line and the Cochran formula. Cochran's formula uses p times one minus p as the expected variance, which is largest at 0.5. Move p away from 0.5 and the required sample shrinks, so a p of 0.3 needs fewer than 385 respondents. If you are only using p for a coin or dice question, reset it to 0.5 before reading the survey figure.
How do I get the chance of at least r successes?
The page only reports the chance of exactly r. For at least three heads in ten flips, run r = 3, 4 and so on up to 10, then add the percentages. For at most, add from r = 0 upward instead. A shortcut is to compute the complement, such as one minus the sum for zero, one and two, which needs fewer runs when r is small.
Why does Z = 1.96 show 0.05 but say significant?
The p-value for 1.96 is very slightly below 0.05, and the display rounds it to 0.05. The significance label is set from the unrounded value, so it reports significant. Lower Z to 1.95 and the p-value reads 0.05118 with a not significant label. A result that close to the cut off should be reported with its exact value rather than as a clear pass.
Can I use this page for a one-tailed test?
Not directly. The p-value is always two-tailed and ignores the sign of Z. For a one-tailed test that you planned before seeing the data, halve the value shown. A Z of 1.645 gives 0.09997 here, which halves to roughly 0.05. Choosing one tail only after looking at the results inflates the false positive rate, so decide the direction in advance.
Can I calculate sample size at 90% or 99% confidence?
No. The sample size formula is fixed at 1.96, the value for 95% confidence, and the Z box only affects the p-value line. For another confidence level, replace 1.96 in the formula on the page with the matching critical value, square it, multiply by p times one minus p, divide by the squared margin and round up. Higher confidence always needs a larger sample.
Why did my n of 3.7 turn into 3?
Both n and r are cut to whole numbers before any counting, because you cannot choose a fraction of an item or run part of a trial. The page does this silently, so 3.7 and 2.9 become C(3, 2), which is 3. If a count looks too small, check the inputs for stray decimals or a value pasted from a spreadsheet with hidden digits.
Does the sample size account for people who do not respond?
No. The 385 figure at the defaults is the number of completed, usable responses you need. If you expect only some invitations to come back, divide the target by your expected response rate to estimate how many people to contact. The page also assumes a simple random sample from a large population, so surveys of small groups may need fewer responses.
Why is the binomial probability shown as 0% for some inputs?
The percentage is rounded to two decimal places, so any chance smaller than half of one hundredth of a percent displays as zero. Five successes in 52 fair trials is a real but tiny probability, and the page shows 0%. If you need the actual size of a rare tail, use software that reports scientific notation rather than rounding to a fixed decimal.
Is a very large combination count exact?
Only its leading digits. The page multiplies in ordinary floating point, which keeps about fifteen or sixteen significant figures. For counts larger than that, the displayed number ends in a run of zeros that are not the true digits. For everyday problems such as card hands or committees the counts are small enough to be exact, but very large values are approximations.
Can I use the permutation count for a PIN or combination lock?
Usually not. nPr assumes each item is used at most once, so it counts codes with no repeated digits. Real PINs allow repeats, and the count for those is simply the number of choices raised to the length of the code, which this page does not compute. Use nPr only when the rules forbid reusing a digit or item.
Does a p-value of 0.05 mean there is a 5% chance my result is wrong?
No. It means that if there were truly no effect, a test statistic at least as extreme as yours would turn up about 5% of the time. It says nothing directly about the chance your hypothesis is true or false, and it does not measure how large or important the effect is. Report the effect size alongside the p-value.
Five answers from one set of inputs
This page is really five small calculators sharing one form. With the defaults of n = 10, r = 3, p = 0.5, Z = 1.96 and a 5% margin of error, the headline reads nCr = 120 and nPr = 720 side by side. The line underneath adds a binomial probability of 11.72%, a two-tailed p-value of 0.05 and a sample size of 385.
Those five figures answer different questions, and only some of them use the same inputs. The combination and permutation counts depend on n and r alone. The binomial probability uses n, r and p. The p-value uses only Z. The sample size uses the margin of error and, less obviously, p as well.
That sharing is the first thing to understand before trusting a result. Changing p to model a loaded coin will also change the survey sample size, and changing Z has no effect on anything except the p-value. Read the output that matches your question and ignore the others.
Combinations, permutations and why 720 is six times 120
Both counts assume you pick r different items from n without putting any back. The difference is whether order matters. Choosing three people for a committee is a combination, because the same three people form the same committee whichever order you name them. Choosing a gold, silver and bronze winner is a permutation, because swapping two of them gives a different result.
The default shows the link between the two. Three chosen items can be arranged in 3 × 2 × 1 = 6 orders, so every combination corresponds to six permutations: 720 divided by 6 gives 120. In general nPr is always nCr multiplied by r factorial.
Growth is fast. Keep r at 3 and drop n to 6, and you get 20 combinations and 120 permutations. Raise n to 15 and the counts jump to 455 and 2,730 respectively. Doubling the pool far more than doubles the number of possible groups.
The edge cases behave as the maths says they should. With r = 0 both counts are 1, since there is exactly one way to pick nothing. With r equal to n there is just one combination, the whole set, while the permutation count becomes n factorial, the number of ways to line up everything.
The binomial line gives exactly r, not at least r
The binomial figure treats n as a number of independent trials, each with the same chance p of success, and returns the chance of exactly r successes. At the defaults that is 11.72%: the probability of exactly three heads in ten fair coin flips.
Exactly is the important word. The chance of three or more heads in ten flips is far higher, because it adds up the cases for four, five and so on up to ten. The calculator does not sum those for you. To get an at least or at most figure, run each value of r and add the results yourself.
The number moves sharply with n. Three successes in 6 trials at p = 0.5 is 31.25%, because three is right in the middle. Three in 15 trials drops to 1.39%, since that many trials would usually produce more. Changing p shifts things too. With n = 10 and r = 3, a p of 0.3 gives 26.68% and a p of 0.1 gives 5.74%.
The display rounds to two decimal places, so rare outcomes can show as 0%. Five successes in 52 trials at p = 0.5 appears as 0% even though the true value is a small positive number. If you need the precise tail value, this page will not show it.
Turning a Z-score into a two-tailed p-value
Enter a Z statistic and the page returns the probability of a result at least that far from zero in either direction, under a standard normal curve. A Z of 1.96 gives the familiar 0.05. A Z of 1 gives 0.31731, a Z of 1.645 gives 0.09997, a Z of 2.58 gives 0.00988 and a Z of 3 gives 0.0027. A Z of 0 returns 1, because every outcome is at least that extreme.
The test is always two-tailed, and the sign does not matter. Minus 1.96 and plus 1.96 both return 0.05. If your hypothesis was one-sided and you predicted the direction in advance, halve the figure shown. Do not halve it after the fact because the data went the way you hoped.
There is a subtle point right at the default. The value displayed for Z = 1.96 is 0.05, yet the label beside it says significant at the 0.05 level. The underlying number is a hair below 0.05 and the display rounds it up. Move Z down to 1.95 and the p-value becomes 0.05118, now marked not significant. A result sitting that close to the line deserves caution in any case.
The curve is calculated with a well known polynomial approximation rather than an exact integral. It is accurate to many decimal places, which is more than any real study needs.
Where the 385 respondents come from, and what moves it
The sample size line uses Cochran's formula at a fixed 95% confidence level. It multiplies 1.96 squared by p times one minus p, divides by the squared margin of error, and rounds up. With p = 0.5 and a 5% margin, that is 384.16 rounded up to 385.
The margin of error has the biggest effect, because it is squared. Widen it to 10% and the answer falls to 97. Tighten it to 3% and it climbs past a thousand. At 1% it is close to ten thousand. Halving the margin roughly quadruples the sample, so decide how precise you really need to be before you budget for a survey.
This line also reads the p box, the same one used for the binomial trials. At p = 0.5 the product p times one minus p is at its largest, which is why 0.5 is the safe choice when you have no idea what the answer will be. Set p to 0.3 and the required sample drops by about a sixth. That is correct maths, but it also means testing a binomial question with a different p silently changes the survey figure. Reset p to 0.5 before reading the sample size unless you have a real prior estimate.
The Z input above has no effect here. The formula always uses 1.96, so a 90% or 99% survey needs to be worked out by hand.
What the sample size leaves out
Cochran's figure assumes a very large population and a simple random sample. If the whole population is small, say the staff of one company, the true number needed is lower, and a finite population correction would reduce it. This page does not apply that correction.
It also counts completed responses, not invitations. If only a fraction of the people you contact reply, you need to approach many more than 385 to end up with 385 usable answers. Planning for that shortfall is part of the job.
Finally, the margin of error applies to a single proportion across the whole sample. If you intend to compare subgroups, such as two age bands, each subgroup needs to be large enough on its own, and the total will be far larger than the single figure shown here. A statistician can help design a survey with subgroups or a stratified sample.
Input limits, whole numbers and very large counts
The counts work for n up to the cap stated in the page's limitations. Past that the factorials exceed what ordinary floating point numbers can hold, and the page shows an error instead of a count. The same error appears if r is larger than n or the margin of error is zero or less.
Decimals in n and r are cut down to whole numbers without a warning. Typing 3.7 and 2.9 gives the result for C(3, 2), which is 3 combinations and 6 permutations. If the counts look smaller than you expected, check that you did not type a fraction.
The rounding rule calls the combinatorics exact, and for everyday sizes it is. For huge counts, though, the arithmetic runs in floating point, which keeps only about fifteen to sixteen significant digits. Choosing half of the largest allowed n displays as a long number ending in a run of zeros. The leading digits are right, but the trailing zeros are not the true digits, so do not copy such a value into anything that depends on its exact last figures.
The binomial line has a quiet limit of its own. Its probability box accepts values from 0.01 to 0.99 on the page, so you cannot model a certain or impossible event directly.
Matching your question to the right output
Before typing anything, decide which of the five questions you are asking. How many different groups or hands are possible: combinations. How many different ordered line ups, codes or rankings: permutations. How likely is a particular count of successes in repeated trials: the binomial line. How surprising is a test statistic you already have: the p-value. How many people should a survey reach: the sample size.
Two common traps sit between the first pair. A combination lock is really a permutation problem, and usually one with repeats allowed, which this page does not model since it assumes no item is reused. A lottery where the order of the drawn balls does not matter is a true combination. Picking the wrong one changes the answer by a factor of r factorial, six times at the default of r = 3.
For the binomial line, make sure the trials really are independent and share the same p. Drawing cards without replacement breaks that, because each draw changes the odds for the next. For the p-value, remember it measures how surprising the data would be if there were no effect, not the chance that your hypothesis is true.