Z-test calculator

Choose a test for a mean or for a proportion, enter your sample result and the value under the null hypothesis, and pick one- or two-sided. You get z, the standard error, the p-value and whether it falls below your significance level.

For a mean, the sample mean x̄. For a proportion, the count of successes (a whole number).
For a mean, the hypothesised mean μ₀. For a proportion, p₀ strictly between 0 and 1.
Mean test only; ignored for a proportion.
A whole number, 1 or more.
Used only for the verdict line. 0.05 is the usual choice.
z statistic2
p-value0.045500264
Standard error
2.5
Sample estimate (x̄ or p̂)
105
At your α
p < α: reject the null hypothesis

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Pick the mean or the proportion test.
  2. Enter the sample result, the value under H₀ and n (and σ for a mean).
  3. Choose the alternative and α, then read z and p.

How it works

The statistic z measures how many standard errors the sample result is from the null value. The p-value comes from the standard normal distribution: 2 × P(Z > |z|) for two-sided, P(Z > z) for right-sided and P(Z < z) for left-sided.

Worked example

Mean test: x̄ = 105, μ₀ = 100, σ = 15, n = 36. The standard error is 15 / 6 = 2.5, so z = 5 / 2.5 = 2. The two-sided p-value is about 0.0455, which is below 0.05.

Proportion test: 60 successes in 100 trials against p₀ = 0.5 gives a standard error of 0.05 and z = (0.6 − 0.5) / 0.05 = 2, with the same p-value.

Tips

  • Decide the alternative before looking at the data; switching to one-sided afterwards halves p unfairly.
  • Statistical significance does not mean the difference matters in practice.

Frequently asked questions

When should I use a z-test instead of a t-test?

Use a z-test for a mean when the population standard deviation is known, or for a proportion with a large enough sample. With an unknown σ and a small sample, a t-test is the usual choice.

What are the formulas?

For a mean, z = (x̄ − μ₀) / (σ / √n). For a proportion, z = (p̂ − p₀) / √(p₀(1 − p₀) / n) with p̂ = successes / n.

What does the p-value mean?

It is the probability, assuming the null hypothesis is true, of a z at least as extreme as yours in the direction of the alternative. Two-sided tests double the one-tail area.

How large must the sample be for a proportion test?

A common rule of thumb is that both n × p₀ and n × (1 − p₀) are at least 10. Below that the normal approximation is rough.

More in Math

All tools in this category: Math ·Updated November 3, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.