Z-Test Calculator | Calculate Z-Score & P-Value


Z-Test Calculator

Determine statistical significance by calculating the Z-Score and P-Value.



The average value of the sample data.


The hypothesized average value of the entire population.


The known standard deviation of the population.


The number of observations in your sample.

Visualization of Z-Score on Standard Normal Distribution

What is a Z-Test?

A Z-test is a statistical hypothesis test used to determine whether two population means are different when the variances are known and the sample size is large. It is based on the standard normal distribution, or Z-distribution. The core idea is to calculate a Z-score, which represents the number of standard deviations a sample mean is from the population mean. This allows us to assess the probability that the observed difference occurred by chance.

This test is commonly used in science and engineering to validate hypotheses. For instance, a researcher might use a Z-test to see if a new drug has an effect on blood pressure by comparing the average blood pressure of a patient sample to the known average for the population. While many analysts know how to calculate z-test using stats library python, a web-based calculator provides instant results without any coding.

Z-Test Formula and Explanation

The formula to calculate the Z-score for a one-sample Z-test is:

Z = (x̄ – μ) / (σ / √n)

This formula helps determine if a sample mean significantly differs from a known population mean. For more complex scenarios, you might investigate a p-value calculator for different statistical tests.

Description of variables in the Z-Test formula.
Variable Meaning Unit Typical Range
Z The Z-Score Unitless -3 to +3 (typically)
The Sample Mean Matches data units Varies with data
μ The Population Mean Matches data units Varies with data
σ The Population Standard Deviation Matches data units Must be positive
n The Sample Size Count n > 30 (recommended)

Practical Examples

Example 1: IQ Scores

A school claims its students are more intelligent than the general population, which has a mean IQ of 100 with a standard deviation of 15. A random sample of 50 students from the school has a mean IQ of 105.

  • Inputs: Sample Mean (x̄) = 105, Population Mean (μ) = 100, Population Standard Deviation (σ) = 15, Sample Size (n) = 50.
  • Calculation: Z = (105 – 100) / (15 / √50) ≈ 2.357.
  • Result: The Z-score is approximately 2.357, which corresponds to a two-tailed P-value of about 0.018. Since this is less than 0.05, the result is statistically significant, supporting the school’s claim.

Example 2: Manufacturing Process

A factory produces bolts with a target length of 200mm. The population standard deviation is known to be 2mm. A quality control check on a sample of 40 bolts finds their average length is 201mm.

  • Inputs: Sample Mean (x̄) = 201, Population Mean (μ) = 200, Population Standard Deviation (σ) = 2, Sample Size (n) = 40.
  • Calculation: Z = (201 – 200) / (2 / √40) ≈ 3.162.
  • Result: The Z-score is approximately 3.162, yielding a very small P-value (around 0.0016). This indicates the manufacturing process is likely producing bolts that are significantly longer than the target. It’s important to understand the difference between this and other tests, which you can read about in our T-Test vs. Z-Test article.

How to Use This Z-Test Calculator

  1. Enter the Sample Mean (x̄): Input the average of your sample data.
  2. Enter the Population Mean (μ): Input the known or hypothesized mean of the population.
  3. Enter the Population Standard Deviation (σ): Input the known standard deviation of the population. This must be a positive number.
  4. Enter the Sample Size (n): Input the number of items in your sample. This must be greater than 0.
  5. Click “Calculate”: The calculator will instantly display the Z-Score, P-Value, and Standard Error of the Mean.
  6. Interpret the Results: Use the P-value to determine statistical significance. A common threshold (alpha level) is 0.05. If the P-value is less than your alpha level, you can reject the null hypothesis.

Key Factors That Affect the Z-Test

  • Difference Between Means (x̄ – μ): The larger the difference between the sample and population means, the larger the absolute Z-score, making a significant result more likely.
  • Population Standard Deviation (σ): A smaller population standard deviation leads to a larger Z-score, as it indicates less natural variability in the population.
  • Sample Size (n): A larger sample size reduces the standard error of the mean. This makes the test more sensitive to differences, increasing the Z-score. Exploring sample size calculation is crucial for planning effective studies.
  • Data Normality: The Z-test assumes the sample means are normally distributed. This assumption is met if the underlying population is normal or if the sample size is large (n > 30) due to the Central Limit Theorem.
  • Known Population Standard Deviation: The Z-test requires that σ is known. If it is unknown, a T-Test, which estimates the standard deviation from the sample, is more appropriate.
  • Significance Level (Alpha): This is the threshold you set for significance (e.g., 0.05). It does not affect the calculation but determines the conclusion you draw from the P-value.

Frequently Asked Questions (FAQ)

What is the difference between a Z-test and a T-test?

A Z-test is used when the population standard deviation (σ) is known and the sample size is large (typically n > 30). A T-test is used when σ is unknown and is estimated from the sample, especially with smaller sample sizes.

What does the P-value tell me?

The P-value represents the probability of observing a result as extreme as, or more extreme than, your sample result, assuming the null hypothesis is true. A small P-value (e.g., < 0.05) suggests that your observed result is unlikely to be due to random chance alone.

Can I use this calculator for a two-tailed test?

Yes, this calculator computes the P-value for a two-tailed test by default. This tests for a significant difference in either direction (greater than or less than the mean).

Why is a large sample size important?

A large sample size (n > 30) gives more reliable estimates of the population. According to the Central Limit Theorem, it also ensures that the distribution of sample means will be approximately normal, which is a key assumption of the Z-test.

What does “statistically significant” mean?

A result is statistically significant if it is unlikely to have occurred by random chance. This is determined by comparing the P-value to a pre-determined significance level (alpha). If P < alpha, the result is deemed significant.

What if my population standard deviation is unknown?

If the population standard deviation is unknown, you should use a T-test instead. The T-test uses the sample standard deviation as an estimate and is more appropriate in this common scenario. We have a guide to statistical tests that may help.

Are the values from this tool as reliable as learning to calculate z-test using stats library python?

Yes, the calculations are based on the same standard formulas. While a library in Python offers more flexibility for complex data analysis, this calculator provides a quick and accurate way to perform a standard one-sample Z-test without needing to code.

What is a Type I Error?

A Type I error occurs when you incorrectly reject a true null hypothesis. The probability of making a Type I error is equal to the significance level (alpha) you set for your test.

Related Tools and Internal Resources

Expand your statistical knowledge by exploring our other calculators and guides:

© 2026 Your Website. All rights reserved. For educational purposes only.



Leave a Reply

Your email address will not be published. Required fields are marked *