Z Test Calculator
A Z Test Calculator helps you find out if the average of a sample is different from the average of a population. You enter your numbers, and the tool calculates your Z score and p value. This tells you if your results are statistically significant or just happened by chance.
One-Sample Z-test Data
Enter all required data to see results
Results will appear here automatically as you type
What is a Z Test?
A Z test is a type of statistical test. It compares the average of a sample data set to the average of a whole population. Scientists and researchers use this test to see if a sample belongs to a specific group or if there is a meaningful difference between them. You usually need a large sample size and a known population standard deviation to use this test. If you need to find the spread of your data first, you can use our standard deviation calculator.
When to Use a Z Test
You should use a Z test instead of other statistical tests when certain conditions are met. Check your data against these rules:
- Your sample size is 30 or larger.
- You know the exact standard deviation of the whole population (this is the main reason the z-test is less common in practice than the t-test).
- Your data points are independent of each other.
- Your data follows a normal distribution, which looks like a bell curve.
If your sample size is smaller than 30 and you do not know the population standard deviation, you should use a T test calculator instead.
How to Use the Z Test Calculator
Using this tool takes less than a minute. Results update automatically as you type, so there is no button to press.
- Choose your test type: one sample, two sample, or proportion.
- Select your alternative hypothesis: two-tailed (≠), left-tailed (<), or right-tailed (>).
- Set your significance level (α), which is usually 0.05.
- Enter the population mean. This is the number you are testing your sample against.
- Enter your sample mean, sample size, and population standard deviation. If you already have a Z score, tick “I already know the Z-score” and enter it directly.
- Read the results panel, which shows the Z score, p value, critical value(s), and whether to reject the null hypothesis at your chosen α.
The Z Test Formula Explained
The math behind the test uses a specific formula. The formula takes the difference between your sample mean and the population mean. Then, it divides that number by the standard error.
The formula is written as: z = (x̄ - μ) / (σ / √n)
Here is what each letter means in simple terms:
- z is your Z score.
- x̄ is the sample mean.
- μ is the population mean.
- σ is the population standard deviation.
- n is the number of items in your sample.
If you need help finding the middle value of your sample before you do the math, you can use our sample mean calculator. You can also check the range of your data with our margin of error calculator.
How to Interpret Z Test Results
Once you run the calculator, you will see several key outputs. Here’s what each one means in practice and how to use them together.
Z-Score
The Z-score shows how many standard errors your sample mean is away from the hypothesized population mean.
- Z close to 0 → Your sample mean is almost exactly what the null hypothesis predicted.
- Positive Z → Sample mean is higher than the hypothesized value.
- Negative Z → Sample mean is lower than the hypothesized value.
- |Z| > 1.96 → Statistically significant at the common 5% level (two-tailed).
- |Z| > 2.58 → Highly significant (1% level).
A large Z-score alone does not tell you whether the difference is important in the real world. It only tells you the result is unlikely to be due to random chance.
P-Value
The p-value is the probability of getting a result at least as extreme as yours if the null hypothesis were true.
- p ≤ 0.05 → Most researchers reject the null hypothesis and call the result statistically significant.
- p ≤ 0.01 → Strong evidence against the null hypothesis.
- p > 0.05 → You do not have enough evidence to reject the null hypothesis. This does not prove the null is true. It only means your data did not show a clear difference.
Critical Value Approach
If your calculated |Z| is larger than the critical value for your chosen significance level and test direction, you reject the null hypothesis. This approach and the p-value approach almost always lead to the same decision.
Practical Significance vs Statistical Significance
Statistical significance (small p-value) only means the difference is unlikely to be random noise. It does not automatically mean the difference is large or important.
Always ask:
- How big is the actual difference in the original units (minutes, points, dollars, etc.)?
- Does that size of difference matter in the real context?
- What is the effect size? (see next section)
A very large sample can make a tiny, practically meaningless difference look statistically significant. Always interpret the numbers in context.
Effect Size and Practical Significance
After checking statistical significance, the next important step is to look at effect size, which is how large the difference actually is.
For a one-sample Z-test, a simple effect size is Cohen’s d:
d = (x̄ − μ) / σ
Guidelines commonly used in the social sciences:
- |d| ≈ 0.20 → Small effect
- |d| ≈ 0.50 → Medium effect
- |d| ≈ 0.80 → Large effect
Example: If your sample mean is 3 points higher than the population mean and σ = 10, then d = 0.30 (small-to-medium effect). Even if the p-value is very small, the practical importance may still be limited.
For two-sample tests, a similar standardized difference between the two means can be calculated. Always report both the p-value and the effect size (or the raw difference) when presenting results.
Limitations of the Z-Test
The Z-test is useful, but it has important limitations you should understand before relying on the results:
Population standard deviation is rarely known
In most real research you only have sample data. When σ is unknown, a t-test is the correct choice.
Assumes normality or large samples
The data should be roughly normal, or the sample size should be large enough (usually n ≥ 30) for the Central Limit Theorem to apply. Highly skewed data or strong outliers can make results misleading.
Requires independent observations
Each data point must be independent. Repeated measures on the same subjects, clustered data, or matched pairs violate this assumption.
Statistical significance ≠ practical importance
Large samples can make tiny differences statistically significant even when they have no real-world meaning. Always examine effect size and the actual difference in original units.
Does not handle more than two groups
Use ANOVA (or other appropriate methods) when comparing three or more groups.
Not suitable for paired or matched data
When the same subjects are measured twice (before/after), use a paired t-test instead.
Sensitive to the choice of α
The conventional 0.05 threshold is arbitrary. In some fields stricter or more lenient levels are preferred.
If any of these conditions are not met, consider a different test or consult a statistician.
Worked Z Test Examples
The examples below use original numbers you can enter in the calculator above. Each one shows the hypotheses, the Z score, the p value, and the decision at α = 0.05.
Example 1: Delivery wait times (one-sample, two-tailed)
A delivery app says the average wait is 22 minutes. From a large archive, the population standard deviation is 6 minutes. A sample of 64 orders in one city has a mean wait of 24.1 minutes. Is the city different from 22 minutes?
- H₀: μ = 22
- H₁: μ ≠ 22
- n = 64, x̄ = 24.1, σ = 6, α = 0.05
Standard error = 6 / √64 = 0.75
Z = (24.1 − 22) / 0.75 = 2.80
Two-tailed p value ≈ 0.0051. The critical values are ±1.96.
Because |2.80| > 1.96 and 0.0051 < 0.05, reject H₀. The city wait time is statistically different from 22 minutes.
Example 2: Laptop battery life (one-sample, left-tailed)
A manufacturer claims mean battery life is 480 hours, with σ = 40 hours. A sample of 36 laptops lasts 472 hours on average. Test whether life is shorter than claimed.
- H₀: μ = 480
- H₁: μ < 480
- n = 36, x̄ = 472, σ = 40, α = 0.05
Standard error = 40 / √36 ≈ 6.667
Z = (472 − 480) / 6.667 = −1.20
Left-tailed p value ≈ 0.115. The critical value is −1.645.
Because −1.20 is not below −1.645 and 0.115 > 0.05, fail to reject H₀. This sample does not give enough evidence that battery life is shorter than 480 hours.
Example 3: Warehouse packing times (two-sample)
A warehouse compares packing time for two shifts. Morning: n₁ = 50, x̄₁ = 8.4 minutes, σ₁ = 1.5. Evening: n₂ = 45, x̄₂ = 9.1 minutes, σ₂ = 1.8. Test whether the two population means differ.
- H₀: μ₁ = μ₂
- H₁: μ₁ ≠ μ₂
- α = 0.05, two-tailed
SE = √(1.5²/50 + 1.8²/45) ≈ 0.342
Z = (8.4 − 9.1) / 0.342 ≈ −2.05
Two-tailed p value ≈ 0.041.
Because |−2.05| > 1.96 and 0.041 < 0.05, reject H₀. The two shifts do not have the same mean packing time.
Example 4: Website Conversion Rate Improvement (One-Sample, Right-Tailed)
A company claims its average order value is $85 with a known population standard deviation of $22. After a redesign, a sample of 100 orders has a mean of $91. Test whether the average order value has increased at α = 0.05.
- H₀: μ = 85
- H₁: μ > 85
- n = 100, x̄ = 91, σ = 22
Standard error = 22 / √100 = 2.2
Z = (91 − 85) / 2.2 = 2.73
Right-tailed p-value ≈ 0.0032. Critical value ≈ 1.645.
Since 2.73 > 1.645 and p < 0.05, reject H₀. There is strong evidence that the average order value has increased.
Effect size d = (91 − 85) / 22 ≈ 0.27 (small-to-medium effect).
Example 5: Student Test Scores Comparison (Two-Sample)
Two large classes take the same exam. Class A: n₁ = 80, x̄₁ = 74.2, σ₁ = 9.1. Class B: n₂ = 75, x̄₂ = 71.8, σ₂ = 10.4. Test whether the population means differ at α = 0.05 (two-tailed).
- H₀: μ₁ = μ₂
- H₁: μ₁ ≠ μ₂
SE = √(9.1²/80 + 10.4²/75) ≈ 1.57
Z = (74.2 − 71.8) / 1.57 ≈ 1.53
Two-tailed p-value ≈ 0.126. Critical values ≈ ±1.96.
Since |1.53| < 1.96 and p > 0.05, fail to reject H₀. There is not enough evidence that the two classes differ in average performance.
Frequently Asked Questions
What is a good Z score?
There is no universal “good” Z score. A Z score near 0 means your sample mean is very close to the hypothesized value. Values beyond ±1.96 are typically considered statistically significant at the 5% level (two-tailed), and values beyond ±2.58 are significant at the 1% level. What matters more is the context: a large Z score with a tiny real-world difference may still have little practical importance. Always look at both the Z score / p-value and the size of the actual difference.
What does a p value of 0.05 mean?
A p-value of 0.05 means that if the null hypothesis were true, there would be only a 5% chance of observing a result as extreme as (or more extreme than) the one you got. By long-standing convention, many fields treat p ≤ 0.05 as the threshold for calling a result “statistically significant” and rejecting the null hypothesis. Remember that 0.05 is arbitrary. Some fields prefer 0.01 or even 0.001 for stronger evidence.
Can I use a Z test for small samples?
Usually no. The Z-test assumes either that the population standard deviation is known or that the sample is large enough (commonly n ≥ 30) for the sampling distribution of the mean to be approximately normal. For small samples or when you only have the sample standard deviation, a t-test is the appropriate choice.
What is the null hypothesis in a Z test?
The null hypothesis (H₀) is the default claim of “no effect” or “no difference.”
- One-sample: H₀: μ = μ₀ (the population mean equals the stated value).
- Two-sample: H₀: μ₁ = μ₂ (the two population means are equal).
You only reject the null hypothesis when the data provide sufficiently strong evidence against it.
What is a two tailed Z test?
A two-tailed (two-sided) Z-test checks for a difference in either direction, whether the sample mean is significantly higher or significantly lower than the hypothesized value. The significance level α is split equally between the two tails of the normal distribution (for example, 0.025 in each tail when α = 0.05). Use a one-tailed test only when you have a clear directional hypothesis before looking at the data.
How do I find the population standard deviation?
True population standard deviation (σ) is rarely known with certainty. It is usually taken from:
- Large previous studies or historical records
- Official statistics or industry benchmarks
- Manufacturer specifications (common in quality control)
If you only have data from your current sample, you should use a t-test (which uses the sample standard deviation) instead of a Z-test.
Created by William Davis
Last updated: September 14, 2026