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
A factory claims mean output = 500 units/day (σ = 30). A sample of 40 days gives x̄ = 508. Test at α = 0.05, two-tailed.
Z = (508 − 500) / (30/√40) = 8 / 4.74 = 1.69. p = 0.091 > 0.05 - Fail to reject H₀.
Example 2 - One-Sample Proportion
A poll shows 55% of 200 voters support candidate A. H₀: p = 0.50, two-tailed, α = 0.05.
Z = (0.55 − 0.50) / √(0.5×0.5/200) = 0.05 / 0.0354 = 1.41. p = 0.158 > 0.05 - Not significant.
Example 3 - Two-Sample Proportions (A/B Test)
Control: 45/100 conversions. Treatment: 55/100 conversions. Two-tailed, α = 0.05.
p̂ = 100/200 = 0.50. Z = (0.55−0.45)/√(0.5×0.5×(1/100+1/100)) = 0.10/0.0707 = 1.41. p = 0.158 - Not significant.
Example 4 - Two-Sample Means
City A (σ=8, n=60, x̄=72) vs City B (σ=10, n=50, x̄=68). Two-tailed, α = 0.05.
Z = (72−68)/√(64/60+100/50) = 4/√(1.067+2) = 4/1.751 = 2.28. p = 0.023 < 0.05 - Reject H₀.