Z-Test Calculator
Test hypotheses about means and proportions using the Z-distribution.
📖 What is a Z-Test?
A Z-test is a hypothesis test based on the standard normal distribution. It is used to determine whether a sample mean or proportion differs significantly from a hypothesised population value, or whether two population means/proportions are significantly different from each other.
The Z-test is appropriate when the population standard deviation σ is known, or when the sample size is large (n > 30), in which case the Central Limit Theorem (CLT) guarantees that the sampling distribution of the mean is approximately normal regardless of the underlying population distribution.
Z-tests for proportions are widely used in A/B testing, survey analysis, and clinical research. They test whether an observed proportion (e.g., 55% click-through rate) differs significantly from a reference value (e.g., 50%), or whether two proportions (e.g., treatment vs. control conversion rates) are significantly different.
📐 Formulas
One-sample proportion: Z = (p̂ − p₀) / √(p₀(1−p₀)/n)
Two-sample means: Z = (x̄₁ − x̄₂) / √(σ₁²/n₁ + σ₂²/n₂)
Two-sample proportions: Z = (p̂₁ − p̂₂) / √[p̂(1−p̂)(1/n₁+1/n₂)]
where p̂ = (x₁+x₂)/(n₁+n₂) is the pooled proportion
p-value (two-tailed): 2 × (1 − Φ(|Z|))
Critical values: α=0.05: ±1.96 | α=0.01: ±2.576 | α=0.10: ±1.645
📖 How to Use This Calculator
📝 Example Calculations
Example 1 - One-Sample Mean
Example 2 - One-Sample Proportion
Example 3 - Two-Sample Proportions (A/B Test)
Example 4 - Two-Sample Means
❓ Frequently Asked Questions
🔗 Related Calculators
What is a Z-test?
A Z-test is a statistical hypothesis test that uses the standard normal (Z) distribution to assess whether a sample mean or proportion differs significantly from a hypothesised value. It is used when the population standard deviation is known, or when the sample size is large enough (n > 30) for the Central Limit Theorem to apply.
When should I use a Z-test vs a t-test?
Use a Z-test when: (1) the population standard deviation σ is known, or (2) the sample size is large (n > 30) because the t-distribution converges to the Z-distribution for large samples. Use a t-test when σ is unknown and the sample is small (n < 30).
How is the Z-test for proportions different from the one for means?
For means: Z = (x̄ − μ₀) / (σ/√n). For proportions: Z = (p̂ − p₀) / √(p₀(1−p₀)/n). Both compare the observed value to the hypothesised value in standard error units. The proportion test uses the binomial standard error under the null hypothesis.
What are the assumptions of the Z-test?
The Z-test assumes: (1) random sampling, (2) independent observations, (3) the population standard deviation is known (for mean tests), and (4) the sampling distribution of the statistic is approximately normal (either because the population is normal or n is large by CLT).
What is a two-sample Z-test?
A two-sample Z-test compares means or proportions from two independent groups. For means: Z = (x̄₁ − x̄₂) / √(σ₁²/n₁ + σ₂²/n₂). For proportions: Z = (p̂₁ − p̂₂) / √(p̂(1−p̂)(1/n₁+1/n₂)) where p̂ is the pooled proportion. It tests H₀: μ₁ = μ₂ or H₀: p₁ = p₂.
When should I use a z-test instead of a t-test?
Use a z-test when: (1) your sample size is large (n >= 30), or (2) the population standard deviation is known. Use a t-test when the population standard deviation is unknown and you estimate it from the sample. With n > 30, the t-distribution approximates the normal distribution so closely that the choice rarely matters.
What is a two-tailed vs one-tailed z-test?
A two-tailed test checks if the mean differs from the null in either direction. Use it when you have no prior hypothesis about direction. A one-tailed test checks for difference in only one direction. Two-tailed is more conservative and is the default in most research. One-tailed tests require strong theoretical justification.
What is a z-score for a sample mean?
The z-score for a sample mean is z = (x-bar - mu0) / (sigma / sqrt(n)), where x-bar is the sample mean, mu0 is the hypothesized population mean, sigma is the known population standard deviation, and n is the sample size. This tells you how many standard errors the sample mean is from the null hypothesis value.