Core inference · Hypothesis tests
Z-Test Calculator
Test a mean or a proportion against a hypothesis using the normal distribution. One- and two-sample z-tests, with the z statistic, a one- or two-tailed p-value, a confidence interval, an effect size and a shaded curve — plus an honest word on when a z-test is the right tool and when you should reach for a t-test instead.
Result
In plain English
A z-test asks whether an observed mean or proportion is far enough from a hypothesised value that chance alone is an unconvincing explanation. It measures the gap in standard errors — that is the z statistic — and converts it into a p-value using the bell curve. It is the large-sample, known-spread cousin of the t-test.
- z statistic
- How many standard errors the estimate sits from the null value: (estimate − null) ∕ standard error. Bigger magnitude means stronger evidence against the null.
- p-value
- The probability of a z at least this extreme if the null hypothesis were true. Small p means the data would be surprising under the null — it is not the probability the null is true.
- one- vs two-tailed
- Two-tailed tests for any difference; one-tailed tests only for a difference in a pre-specified direction. Choose the tail before seeing the data, never after.
- confidence interval
- The range of null values this data would not reject, at the chosen level. If it excludes the null, the two-tailed test is significant.
- z-test vs t-test
- Use a z-test when the population standard deviation is genuinely known (rare) or the sample is large, and for proportions. When σ is estimated from the sample — the usual case for means — the t-test is the honest choice.
Frequently asked
When should I use a z-test instead of a t-test?
Use a z-test when the population standard deviation σ is genuinely known, or for a test of a proportion, or when the sample is large enough that the distinction barely matters (often quoted as n ≥ 30). Use a t-test when you only have the sample's own standard deviation s to estimate σ — which is almost always the case for a mean. For large n the two give nearly identical answers, because the t-distribution converges on the normal.
What is the z critical value for a 95% test?
For a two-tailed test at the 5% level the critical values are ±1.96 (more precisely ±1.95996): a z beyond that range gives p < 0.05. For a one-tailed test at 5% the critical value is 1.645. At the 1% level they are ±2.576 (two-tailed) and 2.326 (one-tailed).
How is the z-test for proportions calculated?
For one proportion, z = (p̂ − p₀) ∕ √[p₀(1 − p₀) ∕ n], using the null value p₀ in the standard error. For two proportions, the standard error uses the pooled proportion p̄ = (x₁ + x₂) ∕ (n₁ + n₂): z = (p̂₁ − p̂₂) ∕ √[p̄(1 − p̄)(1∕n₁ + 1∕n₂)]. Both rely on a large-sample normal approximation, so they need a handful of successes and failures in each group to be trustworthy.
What is the difference between a one-tailed and a two-tailed z-test?
A two-tailed test asks whether the value differs from the null in either direction and splits the significance level between both tails; a one-tailed test looks for a difference in one pre-specified direction only, putting all of α in a single tail, which makes it easier to reach significance. Choose the tail before seeing the data — switching to a one-tailed test afterwards to nudge p under 0.05 is a form of p-hacking.