Compare a single observed rate against a number you already have: a service-level target, a published benchmark, a contractual floor. Size the sample first, then get the exact binomial p-value, the z statistic and a Wilson interval once the counts are in. Two measured rates against each other is a different question and belongs in [the A/B test calculator](/calculators/ab-test-sample-size).
The rate you are testing against — a commitment, a specification or last quarter's figure. It is treated as a fixed number rather than something estimated from data, so the whole question is whether the sample is consistent with it.
A proportion, so 0.12 is 12%.
The nearest-to-target rate the audit should still be able to flag. The sample size is driven by the gap between this and p₀ and nothing else: halve the gap and it roughly quadruples, which is why an audit sized for three points off target is nearly blind to one point off.
The furthest-from-target rate you would still want to catch.
The false-positive rate you agree to run. At α = 0.05 a comparison of two identical things still comes out significant one time in twenty, so lower it when acting on a wrong result is expensive, and split it across comparisons if you are going to run several. The 0.05 is a convention, not a property of your data.
The chance the test finds the effect if the effect is really there. At 0.80 you miss a real one in one study out of five; 0.90 is the usual choice when a miss is the expensive outcome, and costs roughly a third more data. Power is a property of the design — it cannot be recovered after the data is in.
Two-sided asks whether the two differ at all. One-sided asks only whether one beats the other: more sensitive for the same sample, but blind to the opposite result even when it is large. Choose it before the data, for a reason you could have written down in advance — switching afterwards halves the p-value you were about to report.
Required sample size
Observations
884
Gap it is sized forp₁ − p₀ as a share of the target rate.
-25.0%
Achieved powerExact power at the whole n above.
82.5%
Normal approximation would sayWhat a z-based calculator returns.
857
Effect size (Cohen's h)
0.098
Collect 884 observations and the exact binomial test will catch a shortfall to 9.00% against a target of 12.00% about 82.5% of the time. It is sized for that gap and no smaller one: halving the distance between the two rates roughly quadruples the sample, so an audit built to spot three points off target will usually miss one point off target entirely. The figure is the exact test's, which asks for a little more than the normal approximation does because its rejection region is a set of whole counts and cannot spend exactly α.
The normal approximation would have said 857. The exact test needs more, because its rejection region is a set of whole counts and cannot use exactly 5.00% of the null.
The smallest whole-number sample from which power stays above your target reaches 82.5%; exact power moves in steps, not smoothly.
Drag the dashed line — or focus it and use the arrow keys — to change the target power and resize the study.
Show these numbers as a table
Power at each sample size observations
Power
Sample size
0.0%
1
19.2%
151
30.8%
301
50.3%
451
64.1%
601
73.8%
751
80.7%
901
87.9%
1,051
91.0%
1,201
94.4%
1,351
96.5%
1,501
97.8%
1,651
Drag the dashed line — or focus it and use the arrow keys — to change gap from the target rate.
Show these numbers as a table
Required observations against gap from the target rate
Gap from the target rate
Required observations
1.2%
5,694
3.8%
551
6.3%
181
8.9%
83
How many of the sampled units had the outcome — a whole count, not a rate. This is the number the exact binomial test works from, which is why it has to be the count rather than a percentage rounded on the way in.
How many units you looked at in total, including the ones that did not have the outcome. It has to be the whole sample rather than the part you inspected most closely, or the rate is measured against the wrong denominator.
The rate the sample is being tested against, and the one number here that carries no uncertainty of its own — it is a target, not a measurement. If it came from another sample, this is the wrong test: that is a two-proportion comparison.
A proportion, so 0.12 is 12%. Fixed, not itself estimated.
The false-positive rate you agree to run. At α = 0.05 a comparison of two identical things still comes out significant one time in twenty, so lower it when acting on a wrong result is expensive, and split it across comparisons if you are going to run several. The 0.05 is a convention, not a property of your data.
0.05 gives the 95% interval below.
Two-sided asks whether the two differ at all. One-sided asks only whether one beats the other: more sensitive for the same sample, but blind to the opposite result even when it is large. Choose it before the data, for a reason you could have written down in advance — switching afterwards halves the p-value you were about to report.
A half-step adjustment that brings the normal approximation closer to the binomial it is approximating. It moves the z and the p-value derived from it, and never touches the exact binomial p-value above — which is the number to report anyway.
Distance from targetObserved minus target, as a share of the target.
-26.7%
z
-2.202
p from zThe approximation, for comparison only.
0.0277
95% Wilson interval6.6% to 11.6%.
[0.0662, 0.1161]
Standard errorComputed under the target rate, not the observed one.
0.01453
Read the exact binomial p-value of 0.0274: the observed 8.80% is further below the 12.00% target than sampling variation comfortably explains. The true rate is somewhere around 6.6% to 11.6%, and that range is what decides whether the miss is worth acting on — a gap can be real and still be too small to be worth a change. The z statistic's p-value of 0.0277 is the normal approximation to that number, shown for comparison with tools that report only it.
Show these numbers as a table
The observed rate, its interval, and the target
Rate
Estimate
Interval
Observed rate
8.8%
6.6% to 11.6%
When to use it
Use a one-proportion test when there is exactly one group and the comparison value is a constant rather than another sample. The distinction sounds pedantic and is not: a fixed target contributes no sampling variability, so all the uncertainty sits in your one estimate. Typical cases are a quality audit against a 99% accuracy commitment, a delivery SLA, a sales team measured against a published benchmark, or a model's precision checked against the threshold written into a contract.
The trap is using it when the comparison number is not actually fixed. If "last quarter's 12%" was itself measured on a sample, it carries its own error, and treating it as known produces a p-value too small and an interval too narrow. Two measured rates want a two-proportion test — or Fisher's exact test if the counts are small, or McNemar's test if the same units were measured on both occasions. Three or more categories at once want a chi-square goodness-of-fit test, which is this test generalised.
If the outcome is a measurement rather than a yes/no — order value against a target, latency against a budget — the equivalent is a one-sample t-test, and the closest thing here is the paired t-test, which is a one-sample t-test on differences under another name. And if the real question is "can we show we are at least as good as the target?", a non-significant result proves nothing; a non-inferiority test states the margin and tests against it.
Assumptions
The list is short, and one item on it does nearly all the work.
The sample is random with respect to the thing you are measuring. Auditing the 40 tickets that happened to be open on Friday afternoon gives a precise answer about a population you did not mean to study. No test corrects a sampling frame, and this is where one-proportion tests go wrong far more often than they go wrong on distributional grounds.
Observations are independent, with a constant underlying probability. Five hundred emails to one company's domain, or 200 sessions from 40 users, carry far less information than the raw count suggests. Cluster first, then test on the clustered unit.
The target was fixed before the data. A threshold picked after seeing where the estimate landed is not a hypothesis, and the p-value against it means nothing.
Normality, which this calculator does not need for the primary result. Because the exact binomial p-value is computed directly, small samples and rates near 0 or 1 are handled correctly rather than approximately. The z statistic is shown alongside for comparison with other tools, and the two diverge exactly where the approximation is untrustworthy.
How the calculation works
The primary p-value is exact: the binomial distribution under the null is enumerated and the tail probabilities summed, so there is no approximation to be adequate or otherwise. The two-sided version uses the minimum-likelihood convention — every outcome no more likely than the observed one is counted — which is what R's binom.test does and which differs from twice the one-sided p whenever the null proportion is not 0.5. The z is reported as a secondary statistic and the interval is Wilson's, the inversion of that same score test. That is not a decorative detail: it means interval and verdict always agree, whereas pairing a score test with [a Wald interval](/calculators/proportion-confidence-interval) can give a significant p-value and an interval covering the null on the same data.
Exact binomial p-value (two-sided)
p = Σ { P(X = k) : P(X = k) ≤ P(X = x) }, X ~ Binomial(n, p₀)
Summed over every k from 0 to n no more probable under the null than the observed outcome. When p₀ = 0.5 the distribution is symmetric and this equals twice the one-sided tail; otherwise it does not, and the gap is real rather than a rounding artefact.
Score (z) statistic
z = (p̂ − p₀) / √( p₀(1 − p₀)/n ), p̂ = x/n
The denominator uses p₀, not p̂. Putting the observed proportion there gives the Wald statistic, which behaves visibly worse near 0 and 1 and is not what this reports.
The set of null values the score test would not reject. Bounded inside [0, 1] by construction, sensible at zero events, and pulled slightly towards 0.5 — which is the correction, not a bias to undo.
The critical value is set under the null and the power term under the alternative, which is why the two square roots use different proportions. Halving the gap p₁ − p₀ multiplies n by roughly four.
Continuity correction (optional)
z_c = ( |p̂ − p₀| − 1/(2n) ) / √( p₀(1 − p₀)/n )
Shrinks the statistic towards zero to allow for the discreteness of a count. It brings the z-based p-value closer to the exact one at small n, but since the exact value is already computed, it is a convenience for matching other tools rather than an improvement.
Worked example
A client's outbound sequence is supposed to hit the 12% reply rate their agency quoted as the category benchmark. Last quarter 500 prospects received it and 44 replied. Is 8.8% meaningfully short of 12%, or just a quiet quarter?
Successes (x)
44
Sample size (n)
500
Null proportion (p₀)
0.12
Alternative
Two-sided
Significance level (α)
0.05 — a 95% interval
p̂ = 8.8%. Exact binomial p = 0.027; score z = −2.20, normal-approximation p = 0.028. The Wilson 95% interval runs from 6.6% to 11.6%.
The interval excludes 12%, so the shortfall is more than a quiet quarter comfortably explains — but it is wide, spanning everything from a rate barely half the benchmark to one only a whisker below it. The test says nothing about why, and nothing about whether 12% is the right target: it treats that number as a known constant, and if the agency computed it from a few hundred of their own sends it carries error this analysis ignores. Note too that 500 sends was not enough to have counted on catching a shortfall of this size in advance — detecting 9% against a 12% target at 80% power needs 884 by the exact test, or about 857 by the normal approximation the calculator shows beside it. The test cleared the bar because the observed rate landed lower than the design was sized for, which is luck rather than planning.
Interpreting the output
Read the Wilson interval before the p-value. The p-value collapses everything into a comparison against one number; the interval shows the whole range of true rates consistent with what you saw, and against a fixed target it answers the practical question directly — is the target inside the interval or outside it, and if outside, by enough to matter?
A significant result says the true rate is unlikely to equal the target. It says nothing about whether the gap is worth acting on. With 50,000 observations you can separate 11.9% from 12.0% at p < 0.001, and that distinction has no operational meaning. Decide before you run what size of shortfall would trigger a change, then compare the interval against that rather than against 0.05.
A non-significant result is not a clean bill of health. It means the data does not rule the target out, which with a small sample is nearly guaranteed. Look at the width: if the interval stretches from 4% to 30%, the honest report is that the audit was too small to conclude anything. When the question really is "prove we are meeting it", flip it round and use a non-inferiority test, where the burden of proof sits the right way up.
Finally, resist running this test on several targets at once. Checking a dozen SLAs at 5% each gives roughly a one-in-two chance that at least one looks breached when none is — the arithmetic in the problem of multiple comparisons. For the whole picture across categories, a goodness-of-fit test asks the question once. And if the underlying question is whether something caused the shortfall rather than whether it exists, no one-sample test can answer it; that needs a causal design.
Frequently asked questions
Why does the exact p-value differ from the z-test p-value?
Because the count is discrete and the normal curve is not. The z-test approximates a binomial distribution with a smooth one, and the approximation is good when the expected number of successes and failures are both comfortably into double figures, and poor when they are not. With 44 successes out of 500 the two agree to the third decimal, which is why you can trust either. With 4 out of 30 they can differ enough to move a conclusion, and there the exact answer is simply correct — it is computed from the binomial itself rather than from a curve fitted to it.
Why is the two-sided exact p-value not just double the one-sided one?
Doubling only works when the null distribution is symmetric, which for a binomial happens only when the null proportion is exactly 0.5. Otherwise the two tails have different shapes and there is no single obviously right way to combine them. The convention used here, and by R's binom.test, is minimum likelihood: add up the probability of every outcome no more likely than the one you saw. It is coherent, it is what most published analyses use, and it explains why your number may differ in the third decimal from a tool that simply doubles.
My target came from last year's data. Can I still use this test?
Only if last year's figure rests on so much data that its own error is negligible next to your new sample — a rate from a full year of millions of transactions, tested against this month's few hundred. If both numbers come from samples of comparable size, treating one as fixed understates the uncertainty and inflates significance, sometimes badly. In that case use a two-proportion test, which accounts for error in both.
I observed zero successes. What can I conclude?
More than you would think, and the Wilson interval handles it without special pleading. Zero out of 40 gives a 95% interval of roughly 0% to 8.8%: you have not shown the rate is zero, you have shown it is probably below about nine percent. The quick mental version is the rule of three, where the one-sided 95% upper bound for no events in n trials is about 3 divided by n — 7.5% here, in the same neighbourhood. What you must not do is compute a Wald interval, which returns the point zero with zero width and is simply wrong.
How many observations do I need?
It depends far more on the gap you want to detect than on the size of the population. Detecting a rate of 9% against a 12% target at 80% power and 5% two-sided takes 884 observations by the exact test; detecting 6% against the same target takes about 195. Halving the gap you care about roughly quadruples the requirement. If you are sizing an audit rather than a test, work from the interval width you can live with instead — that question belongs in the proportion confidence interval calculator.
We build measurement that answers the question you asked, with the uncertainty stated rather than rounded away. A/B Testing
References
Agresti, A. (2013). Categorical Data Analysis (3rd ed.). Wiley.
Brown, L. D., Cai, T. T., & DasGupta, A. (2001). Interval estimation for a binomial proportion. Statistical Science, 16(2), 101-133.
Wilson, E. B. (1927). Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association, 22(158), 209-212.