Z Test Calculator
- Rejection region α
- p-value area
- Observed z
- Critical value
Drag the needle — your sample result updates to match
Drag the needle — your sample result updates to match
A z-test is a statistical hypothesis test that uses the standard normal distribution to decide whether a sample mean or proportion differs from a hypothesized value or from a second sample.
The z-test turns the gap between a sample estimate and the null value into a z statistic: the number of standard errors (SE) separating the two. A z statistic near 0 fits the null hypothesis, and a z statistic far from 0 counts as evidence against the null hypothesis. The z-test applies when the population standard deviation (σ) is known or the sample is large (n ≥ 30), so the sampling distribution is approximately normal.
The z-test belongs to statistical inference, the use of a sample to draw conclusions about a population. Ronald A. Fisher set out significance testing and the p-value in Statistical Methods for Research Workers (1925), and Karl Pearson developed the correlation coefficient compared by Fisher’s z-test. The National Institute of Standards and Technology (NIST) covers z-tests for means and proportions in the NIST/SEMATECH e-Handbook of Statistical Methods. Statistical software runs z-tests too, including R, Python (SciPy and statsmodels), SPSS and Minitab.
The null hypothesis (H₀) states that there is no effect or no difference, and the alternative hypothesis (H₁) states the effect the test looks for. For a school that claims a mean score of 100, the hypotheses are H₀: μ = 100 and H₁: μ ≠ 100. The z-test assumes H₀ is true and measures how unusual the sample result is under that assumption. Build and check both hypotheses with the hypothesis test calculator.
There are 6 types of z-tests, grouped by the type of data and the number of samples: one-sample, two-sample, paired, one-proportion, two-proportion and correlation z-tests.
A one-sample z-test compares one sample mean (x̄) with a hypothesized population mean (μ₀) when σ is known. Example: do 50 students with a mean score of 104.2 differ from the national mean of 100?
One-sample z test calculator →A two-sample z-test compares the means of 2 independent groups with known standard deviations σ₁ and σ₂. Example: the average order value of 2 online stores.
Two-sample z test calculator →A paired z-test compares 2 measurements on the same subjects, such as before and after a training course, using the mean difference (d̄) and the known standard deviation of the differences (σd).
Paired z-test calculator →A one-proportion z-test compares a sample proportion (p̂) with a hypothesized proportion (p₀). Example: 58 of 100 voters support a policy; is support different from 50%? The test needs np₀ ≥ 10 and n(1 − p₀) ≥ 10.
One-proportion z test calculator →A two-proportion z-test compares the proportions of 2 independent groups with a pooled standard error. A/B tests use the two-proportion z-test to compare conversion rates, such as 30% versus 21.4%.
Two-proportion z test calculator →Fisher’s z-test compares 2 correlation coefficients from independent samples after the Fisher transformation z′ = arctanh(r). Steiger’s z-test compares 2 dependent correlations that share one variable within the same sample.
Fisher’s z-test calculator → Steiger’s z-test calculator →Choose a z-test by answering 2 questions: what type of data you have, and how many groups or measurements you compare.
| Data type | One sample vs. a known value | Two independent groups | Two related measurements | Three or more groups |
|---|---|---|---|---|
| Mean, σ known (or n ≥ 30) | One-sample z-test | Two-sample z-test | Paired z-test | One-way ANOVA |
| Mean, σ unknown, n < 30 | One-sample t-test | Welch two-sample t-test | Paired t-test | One-way ANOVA |
| Proportion (yes/no) | One-proportion z-testsmall n: binomial test | Two-proportion z-testsmall n: Fisher’s exact test | McNemar test | Chi-square test |
| Correlation (r) | — | Fisher’s z-test | Steiger’s z-test | — |
| Variance (σ²) | Chi-square test | F-test | — | Levene’s test |
Shaded cells are z-tests. Four rules cover most cases:
A z-test gives valid results when 4 assumptions hold: a known population standard deviation, a large enough sample, normality and independent observations.
The z-test formula uses the population standard deviation (σ) in the standard error. σ comes from a census, a long run of past data or a manufacturer specification. Switch to a t-test when σ is estimated from a sample of fewer than 30 observations.
The Central Limit Theorem (CLT) makes the sampling distribution of x̄ approximately normal once n reaches about 30. Proportion z-tests need at least 10 expected successes and 10 expected failures: np₀ ≥ 10 and n(1 − p₀) ≥ 10. Plan the sample with the sample size calculator.
The population needs to be approximately normal for samples under 30. Check normality with a histogram, a Q-Q plot or the Shapiro-Wilk test in R, Python, SPSS or Minitab. Strong skew or outliers in a small sample break the z-test.
Each observation must not influence another. Random sampling and a sample smaller than 10% of the population meet this assumption. Repeated measures on the same subjects need the paired z-test.
The z-test formula for one sample mean is z = (x̄ − μ₀) / (σ / √n).
The numerator is the observed difference. The denominator, σ / √n, is the standard error.
Every z statistic equals (estimate − hypothesized value) / standard error. The estimate and the standard error change with the type of z-test:
| Z-test | Estimate | Standard error |
|---|---|---|
| One-sample | x̄ − μ₀ | σ / √n |
| Two-sample | (x̄₁ − x̄₂) − Δ₀ | √(σ₁²/n₁ + σ₂²/n₂) |
| Paired | d̄ − Δ₀ | σd / √n |
| One-proportion | p̂ − p₀ | √(p₀(1 − p₀) / n) |
| Two-proportion | p̂₁ − p̂₂ | √(p̂(1 − p̂)(1/n₁ + 1/n₂)), pooled p̂ |
| Fisher’s z | z′₁ − z′₂ | √(1/(n₁ − 3) + 1/(n₂ − 3)) |
The standard error (SE) is the standard deviation of the sampling distribution of a statistic. The standard deviation (SD) measures the spread of individual values, and the standard error measures the spread of sample means. The standard error of the mean is SE = σ / √n, so the standard error falls as the sample grows: quadrupling n halves the SE. For σ = 15, the SE is 3 at n = 25, 1.5 at n = 100 and 0.75 at n = 400. Calculate the SD of raw data with the standard deviation calculator.
To perform a z-test, follow 7 steps from the hypotheses to the conclusion:
The Z Test Calculator runs steps 4 to 7 automatically and prints every step with your numbers in “The working, step by step”.
To use the Z Test Calculator, complete the 4 numbered panels on the left and read the results on the right.
The calculator returns 8 results: the z statistic, the p-value, the decision stamp, the critical value, the confidence interval, the effect size (Cohen’s d or Cohen’s h), the step-by-step working and an assumption check. All calculations run in your browser, and no data leaves your device.
A two-tailed z-test checks for a difference in either direction, while a one-tailed z-test checks for a difference in one stated direction.
| Test | H₁ | p-value | z* at α = 0.10 | z* at α = 0.05 | z* at α = 0.01 |
|---|---|---|---|---|---|
| Two-tailed | μ ≠ μ₀ | 2 · P(Z ≥ |z|) | ±1.645 | ±1.960 | ±2.576 |
| Left-tailed | μ < μ₀ | P(Z ≤ z) | −1.282 | −1.645 | −2.326 |
| Right-tailed | μ > μ₀ | P(Z ≥ z) | +1.282 | +1.645 | +2.326 |
A two-tailed test splits α between both tails, so each tail holds α/2 = 0.025 at α = 0.05 and the critical values are ±1.96. Use a two-tailed test when any difference matters, such as a machine filling bottles too much or too little.
A left-tailed test puts all of α in the lower tail, so the critical value is −1.645 at α = 0.05. Use a left-tailed test when only a decrease matters, such as checking that a battery lasts less than the advertised 10 hours.
A right-tailed test puts all of α in the upper tail, so the critical value is +1.645 at α = 0.05. Use a right-tailed test when only an increase matters, such as testing whether a new teaching method raises mean scores. Choose the tail before looking at the data.
The p-value approach and the critical value approach always reach the same decision at the same significance level. The p-value approach rejects H₀ when p ≤ α, and the critical value approach rejects H₀ when z falls in the rejection region.
The p-value is the probability of a result at least as extreme as the observed one, assuming H₀ is true. Convert a z statistic with the z score to p-value calculator, or convert t, χ² and F statistics with the p-value calculator. Go the other way with the p-value to z score calculator.
A critical value is the z score that marks the edge of the rejection region for a chosen α and tail. Find z* for any confidence level with the z critical value calculator, and translate the region into sample-mean units with the rejection region calculator. Plot both approaches on one chart with the z-test graph.
Interpret a z-test result in 4 parts: the z statistic, the p-value, the confidence interval and the effect size.
The sign of the z statistic gives the direction of the difference, and the size gives the distance in standard errors. A z statistic of +1.98 means the sample mean is 1.98 standard errors above μ₀. In a two-tailed test, |z| > 1.96 is significant at α = 0.05 and |z| > 2.576 is significant at α = 0.01. Check single values with the z-score calculator.
A p-value of 0.0477 means a result this extreme happens in 4.77% of samples when H₀ is true. The p-value is not the probability that H₀ is true. The American Statistical Association (ASA) statement on p-values (2016) lists 6 principles, including that a p-value does not measure the size of an effect and that a decision should not rest on p < 0.05 alone. Use 3 reference points for two-tailed results: p ≤ 0.05 is significant, p ≤ 0.01 is highly significant and p ≤ 0.001 is very highly significant.
A 95% confidence interval for the mean is x̄ ± 1.96 · SE, the range of plausible values for μ. A two-tailed z-test at α = 0.05 rejects H₀ exactly when the 95% confidence interval excludes μ₀. For x̄ = 104.2 and SE = 2.1213, the interval is [100.04, 108.36], which excludes 100. Build intervals for means and proportions with the confidence interval calculator.
Statistical significance shows that a difference is unlikely to be chance, while practical significance shows that the difference is large enough to matter. Large samples make tiny differences significant: a 0.5-point gain with σ = 15 and n = 10,000 gives z = 3.33 and p = 0.0009 but a Cohen’s d of only 0.03. Cohen’s d uses 3 benchmarks: 0.2 is small, 0.5 is medium and 0.8 is large. Measure effect sizes with the effect size calculator.
A z-test uses a known population standard deviation and the normal distribution, while a t-test estimates the standard deviation from the sample and uses the t distribution.
| Feature | Z-test | T-test |
|---|---|---|
| Standard deviation | Population σ, known | Sample s, estimated |
| Distribution | Standard normal | Student’s t with n − 1 degrees of freedom |
| Typical sample size | n ≥ 30, or any n with known σ | Any n, often n < 30 |
| Two-tailed critical value, α = 0.05 | 1.960 for every n | 2.776 (n = 5), 2.093 (n = 20), 2.045 (n = 30) |
| Proportions | Yes | No |
Run summary-statistic t-tests with the t-test calculator.
A school district claims the mean test score is 100 with a population standard deviation of 15. A random sample of 50 students has a mean score of 104.2. At α = 0.05, does the mean score differ from 100?
Conclusion: the mean score of the district’s students differs from 100 (z = 1.98, p = .048), and the difference is small (d = 0.28). Open this example in the calculator
Each z-test calculator page includes a worked example with its own data:
The z-test has 6 limitations:
There are 8 common mistakes when running a z-test:
A z-table lists the cumulative probability P(Z ≤ z) of the standard normal distribution for z-scores from −3.49 to 3.49.
To read the z-table, find the row for the first decimal of z and the column for the second decimal. For z = 1.96, the row 1.9 and the column 0.06 give 0.9750, so 97.5% of the area lies below 1.96. The right-tail area is 1 − 0.9750 = 0.0250, and the two-tailed p-value is 2 × 0.0250 = 0.05.
| z | P(Z ≤ z) | Two-tailed area |
|---|---|---|
| 1.282 | 0.9000 | 0.2000 |
| 1.645 | 0.9500 | 0.1000 |
| 1.960 | 0.9750 | 0.0500 |
| 2.326 | 0.9900 | 0.0200 |
| 2.576 | 0.9950 | 0.0100 |
The full table for every z from −3.49 to 3.49, with an interactive lookup and left, right, mean-to-z and two-tailed versions, is on the z-table page. Open the full z-table
A z-score measures how many standard deviations one value lies from the mean, while a z-test uses a z statistic to test a hypothesis about a population mean or proportion. A z-score describes one data point, such as an exam score of 85 being 1.5 standard deviations above a mean of 70. A z-test describes a sample: it divides the gap between a sample mean and a hypothesized mean by the standard error, then turns that z statistic into a p-value. Calculate single scores with the z-score calculator.
A negative z-score in a z-test means the sample mean or proportion is below the hypothesized value. The sign shows the direction and the size shows the distance in standard errors. A z statistic of −2.10 lies 2.10 standard errors below the null value and gives a two-tailed p-value of 0.036. A negative z-score is significant in a two-tailed or left-tailed test when it passes the critical value, and it is never significant in a right-tailed test.
Use a t-test when the population standard deviation is unknown and the sample has fewer than 30 observations. The t-test calculator estimates σ with the sample standard deviation (s) and uses the t distribution. With 30 or more observations, the sample standard deviation is a close estimate of σ and a z-test gives nearly the same answer: the two-tailed critical value is 2.045 for a t-test with 29 degrees of freedom and 1.960 for a z-test. In the Z Test Calculator, paste raw data and select “Use s as σ” to run this large-sample z-test.
No, a z-test cannot prove the null hypothesis is true. A z-test either rejects H₀ or fails to reject H₀. “Fail to reject” means the sample did not give enough evidence against H₀, which happens with small samples even when a real difference exists. To show that two means are practically equal, run an equivalence test such as two one-sided tests (TOST) with a pre-set equivalence margin.
Reject the null hypothesis when the p-value equals the significance level exactly, since the decision rule is p ≤ α. An exact tie is rare with continuous data: a z statistic of 1.95996 gives p = 0.0500 when rounded to 4 decimals. Report the exact p-value, such as p = .050, so readers judge the evidence directly instead of relying on the cut-off alone.
The confidence level equals 1 minus the significance level (1 − α). The significance level (α) is the probability of rejecting a true null hypothesis, a Type I error. The confidence level is the share of confidence intervals that contain the true parameter over repeated samples. A significance level of 0.05 matches a 95% confidence level, 0.01 matches 99%, and 0.10 matches 90%.
Yes, a z-test is a parametric test. A z-test assumes the sampling distribution of the statistic is normal with known parameters, the mean (μ) and the standard deviation (σ). Non-parametric tests drop the normality assumption, including the sign test, the Wilcoxon signed-rank test and the Mann-Whitney U test. For yes/no data in small samples, the binomial test and Fisher’s exact test give exact p-values.
A z-test for means needs at least 30 observations when the population is not normal, and a z-test for proportions needs np₀ ≥ 10 and n(1 − p₀) ≥ 10. To plan a study, the sample size for estimating a mean is n = (z* · σ / E)², where E is the margin of error. For σ = 15, E = 3 and 95% confidence, n = (1.96 × 15 / 3)² = 96.04, so 97 observations. Use the sample size calculator for means and proportions.
No, a z-test compares one or two groups only. Use the ANOVA calculator to compare 3 or more means and the chi-square calculator to compare 3 or more proportions. Running separate z-tests for every pair inflates the Type I error rate: 3 pairwise tests at α = 0.05 give a 14.3% chance of at least one false positive.
Use =Z.TEST(range, μ₀, σ) in Excel or Google Sheets to get the right-tailed p-value of a one-sample z-test. For data in A2:A51, a hypothesized mean of 100 and σ = 15, the formulas are:
=Z.TEST(A2:A51,100,15)=2*MIN(Z.TEST(A2:A51,100,15),1-Z.TEST(A2:A51,100,15))=(AVERAGE(A2:A51)-100)/(15/SQRT(COUNT(A2:A51)))=2*(1-NORM.S.DIST(ABS(B1),TRUE))=NORM.S.INV(0.975) (returns 1.96)Leave out the σ argument and Z.TEST uses the sample standard deviation instead.
Report a z-test in APA format as z = 1.98, p = .048, with the sample mean, standard deviation, sample size and effect size. APA style (7th edition) has 4 rules for test results: italicize z and p, give the z statistic to 2 decimals, give p to 2 or 3 decimals without a leading zero, and write p < .001 for smaller values. Example: “The mean score of the 50 students (M = 104.2) was significantly higher than the population mean of 100, z = 1.98, p = .048, d = 0.28.”