ThisCalculator

Statistics

1 Prop Z Test Calculator: Formula and Example

Updated · Standard formula, shown below

The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.

1 Prop Z Test Calculator: Formula and Example

A 1 prop z test calculator checks whether a sample proportion differs significantly from a hypothesized population proportion using a one-sample z test. Enter the hypothesized proportion, the number of successes, and the sample size to get the z statistic and a two-sided p-value; use the result to assess evidence, not to prove a claim.

Formula

The one-proportion z statistic is z = (p̂ − p₀) / √[p₀(1 − p₀) / n], where p̂ = x/n is the sample proportion, p₀ is the hypothesized population proportion, x is the number of successes, and n is the total sample size. The standard error in the denominator is calculated under the null hypothesis. The calculator reports the two-sided p-value as 2[1 − Φ(|z|)], where Φ is the cumulative distribution function of the standard normal distribution. The p-value expression shown in the calculator uses erf, the error function.

Here, p₀ and p̂ are proportions from 0 to 1, while x and n are counts; z and the p-value have no physical units. The p-value is between 0 and 1. This setup tests the two-sided alternative that the true proportion is different from p₀, rather than specifically greater or less.

Worked Example

With the displayed defaults, the hypothesized proportion is p₀ = 0.5, there are x = 60 successes in n = 100 observations, and the sample proportion is p̂ = 60/100 = 0.6.

First calculate the null standard error: √[0.5 × (1 − 0.5) / 100] = √0.0025 = 0.05. Then calculate z: (0.6 − 0.5) / 0.05 = 2. The two-sided p-value is 2[1 − Φ(2)], approximately 0.0455, which rounds to 0.0455 at four decimal places.

When to Use a One-Proportion Z Test

Use this test when each observation falls into one of two categories, such as yes/no, pass/fail, or defective/not defective, and you want to compare the observed success proportion with a stated benchmark. The observations should be independent, and the sample should be suitable for treating the count as binomial. For example, it can assess whether a survey’s share of “yes” responses differs from a prespecified proportion, provided the sampling design supports that inference.

This is not a test of the difference between two proportions; that requires a two-proportion procedure. It also does not directly test a population mean or a continuous measurement. If observations are paired, clustered, weighted, or otherwise dependent, a basic one-sample z test may not represent the data structure.

How to Read the Result

The sign of z shows the direction: a positive value means the sample proportion exceeds p₀, and a negative value means it falls below p₀. The absolute size of z indicates how far the observed proportion is from the null value in estimated standard-error units. The p-value measures how often a result at least this far from p₀ would occur under the null model, assuming the model’s conditions hold.

Compare the p-value with a significance level chosen before examining the result. If it is below that threshold, the data provide evidence against the null hypothesis; if it is above, they do not provide sufficient evidence to reject it. A p-value is not the probability that the null hypothesis is true, and statistical significance does not establish practical importance. Consider the actual difference p̂ − p₀ and, where needed, a confidence interval as well.

Assumptions and Common Mistakes

The normal approximation is most dependable when the expected counts under the null are large enough: check both np₀ and n(1 − p₀). A commonly used rule of thumb is that both should be at least 10, although conventions vary. If counts are small, especially when p₀ is near 0 or 1, consider an exact binomial test instead of relying on the z approximation.

Enter x as the count of outcomes defined as successes and n as the total number of eligible observations; x cannot exceed n. Enter p₀ as a proportion, such as 0.25 for 25%, not as 25. The calculation uses the null proportion p₀ in its standard error, not the observed proportion p̂. Rounding the input proportion or counts can change the result, so use the original counts and retain precision until reporting. Also ensure the sample was collected in a way that supports the intended population inference.

How to Choose

For a one-proportion z test calculator, first check that it accepts p₀ as a proportion and takes the success count and total sample size separately. Those inputs let you verify p̂ and reduce mistakes from entering a rounded percentage. Next, confirm whether the displayed p-value is one-sided or two-sided; this calculator uses a two-sided alternative, so it is appropriate when departures in either direction matter.

Look for a clearly stated normal-approximation condition and enough output to interpret the result, especially the z statistic and p-value. A calculator that only returns a p-value can hide the direction and scale of the difference. If the null expected counts are small, choose a tool for an exact binomial test rather than treating the z result as reliable. No calculator can determine whether the sample is representative or observations are independent; those are properties of the study design.

Frequently Asked Questions

What does a 1 prop z test calculator calculate?
It calculates a z statistic for one sample proportion against a hypothesized proportion, then uses the normal distribution to estimate a p-value.

What does p₀ mean?
p₀ is the population proportion specified by the null hypothesis. Enter it between 0 and 1; for example, 40% is 0.40.

Is the p-value in this calculator one-sided or two-sided?
It is two-sided: it counts evidence for a sample proportion either above or below p₀. A directional, one-sided test requires a different p-value calculation.

When should I use an exact binomial test instead?
Use an exact method when the expected success or failure count under the null is small, or when the normal approximation is questionable. Check both np₀ and n(1 − p₀).

Does a small p-value prove the hypothesized proportion is false?
No. It indicates that the data would be relatively unusual under the null model, subject to the test’s assumptions. It does not prove a hypothesis or measure the effect’s practical importance.

Final Thoughts

A one-proportion z test is a focused way to compare a binary-outcome sample with a stated benchmark. Check the sampling assumptions and expected counts, then interpret the z statistic and p-value alongside the observed proportion and the study context.

Related

Formula used
in p0 | Hypothesized proportion | - | 0.5 | 0
in x | Number of successes | - | 60 | 0
in n | Sample size | - | 100 | 1
out z | Z statistic | - | (x / n - p0) / sqrt(p0 * (1 - p0) / n) | 3
out p | Two-sided p-value (normal approximation) | - | 2 * (1 - 0.5 * (1 + erf(abs(z) / sqrt(2)))) | 4

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.