What this calculator does
This tests whether an observed proportion differs from a hypothesised one. A sample of 150 splitting 58-42 against a hypothesis of 50% gives z = 1.960 and a two-tailed p-value of 0.0500.
That example sits exactly on the conventional threshold, and it is worth dwelling on. The p-value rounds to 0.0500 in the display but is actually 0.05004, so the calculator correctly reports it as not significant at 5%. A result this close to the line is a reason to gather more data, not to argue about the fourth decimal place.
The formula
The z-statistic is the difference between the sample and hypothesised proportions, divided by the standard error computed under the null hypothesis. That standard error uses the hypothesised proportion rather than the observed one, which is the correct choice for a test but differs from the standard error used to build a confidence interval. The p-value is two-tailed.
| Term | Meaning |
|---|---|
| p̂ (p-hat) | The observed sample proportion. |
| p₀ | The hypothesised population proportion being tested against. |
| Two-tailed | Testing for a difference in either direction, which is the usual default. |
| Null standard error | √(p₀(1−p₀)/n), computed under the hypothesis rather than from the sample. |
The inputs explained
| Field | What to enter |
|---|---|
| Sample proportion (p̂) (%) | Observed sample proportion as a percentage. |
| Hypothesised proportion (p₀) (%) | The proportion you are testing against, from theory, a previous study or a target. |
| Sample size | Sample size. The normal approximation needs at least about 10 expected successes and 10 expected failures. |
When to use it
Testing against a known rate
Whether an observed rate differs from a published or historical figure.
Checking a fairness claim
Whether an outcome rate differs from the 50% a fair process would produce.
Evaluating a single-arm result
Comparing an observed success rate against a pre-specified target rather than against a control group.
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
What does each sample proportion give?
A range of observed proportions against the same hypothesis.
| Sample proportion | Z-statistic | Two-tailed p-value | Significant at 5%? |
|---|---|---|---|
| 52% | 0.4899 | 0.6242 | No |
| 55% | 1.225 | 0.2207 | No |
| 58% | 1.960 | 0.0500 | No |
| 62% | 2.939 | 0.0033 | Yes |
Questions
Why does a p-value of 0.0500 show as not significant?
Because the displayed figure is rounded to four decimal places. The exact value here is 0.05004, which is above 0.05. A result sitting this close to the threshold should prompt more data rather than a decision either way, since the conventional cutoff is arbitrary.
Which standard error does this use?
The one computed under the null hypothesis, using p₀ rather than the observed proportion. That is correct for a hypothesis test. A confidence interval around the observed proportion uses p̂ instead, which is why a test and an interval can occasionally disagree at the margin.
How large a sample do I need?
The normal approximation needs roughly ten expected successes and ten expected failures, so n times p₀ and n times (1−p₀) should both be at least 10. Below that, use an exact binomial test rather than this approximation.
Should I use a one-tailed test?
Only if you committed to a direction before seeing the data and a result in the other direction would be of no interest. Switching to one-tailed after looking at the result, which halves the p-value, is a well-known form of p-hacking.
For comparing two proportions, see the two-proportion z-test calculator. For the margin of error instead, see the margin of error calculator.