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


Z-Test & Z-Score Calculator

A powerful tool to calculate z-test using stats, finding the z-score and p-value for hypothesis testing.



The hypothesized mean of the population.


The known standard deviation of the population.


The mean calculated from your sample data.


The number of observations in your sample.


What is a Z-Test?

A Z-test is a fundamental statistical hypothesis test used to determine whether the mean of a sample is significantly different from a known or hypothesized population mean when the population’s standard deviation is known. It is a type of inferential statistics, which means it allows us to draw conclusions about a whole population based on a smaller sample. To use a Z-test, the data should be approximately normally distributed, and the sample size should ideally be greater than 30. The primary output of a Z-test is a Z-score (or Z-statistic), which represents how many standard deviations the sample mean is away from the population mean.

Z-Test Formula and Explanation

The formula for a one-sample Z-test is straightforward and measures the difference between the sample and population means in units of standard error. The formula is:

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

This formula allows us to quantify the evidence against the null hypothesis. A large absolute Z-score suggests that the observed sample mean is unlikely to have occurred by random chance if the null hypothesis were true. You can find more information about hypothesis testing at our Confidence Interval Calculator.

Variables Table

Variable Meaning Unit Typical Range
Z The Z-score test statistic Unitless Typically -3 to +3
The Sample Mean Depends on data Varies
μ The Population Mean Depends on data Varies
σ The Population Standard Deviation Depends on data > 0
n The Sample Size Unitless ≥ 30 is recommended

Practical Examples

Example 1: Testing Student IQ Scores

A school principal claims that the average IQ of students in her school is above the national average of 100. The national standard deviation is 15. She takes a random sample of 35 students, and their average IQ is 105.

  • Inputs: μ = 100, σ = 15, x̄ = 105, n = 35
  • Calculation: Z = (105 – 100) / (15 / √35) ≈ 1.97
  • Result: The Z-score is 1.97. The corresponding one-tailed p-value is approximately 0.024. Since this is less than the common significance level of 0.05, she can reject the null hypothesis and conclude there is evidence her students have a higher average IQ. Explore more about statistical significance with our p-value from z-score tool.

Example 2: Manufacturing Process

A factory produces bolts with a target length of 50mm and a known standard deviation of 0.5mm. A quality control inspector takes a sample of 50 bolts and finds their average length is 49.8mm. He wants to know if the manufacturing process is off-target.

  • Inputs: μ = 50, σ = 0.5, x̄ = 49.8, n = 50
  • Calculation: Z = (49.8 – 50) / (0.5 / √50) ≈ -2.83
  • Result: The Z-score is -2.83. For a two-tailed test, the p-value is approximately 0.0046. This is highly significant, indicating that the production process is likely producing bolts that are shorter than the target length. Understanding this deviation is key, much like understanding a Standard Deviation Calculator.

How to Use This Z-Test Calculator

  1. Enter Population Mean (μ): This is the established or hypothesized average of the entire population you are comparing against.
  2. Enter Population Standard Deviation (σ): This is a critical prerequisite for a Z-test—you must know the standard deviation of the population.
  3. Enter Sample Mean (x̄): Input the average calculated from your collected sample data.
  4. Enter Sample Size (n): Provide the total number of items in your sample. A larger sample size generally leads to more reliable results. See how sample size impacts studies with our Sample Size Calculator.
  5. Click “Calculate”: The tool will instantly compute the Z-score, p-values, and standard error.
  6. Interpret the Results: The main values to check are the Z-score and the p-value. A p-value less than your chosen significance level (e.g., 0.05) indicates a statistically significant result.

Key Factors That Affect the Z-Test Result

  • Difference Between Means (x̄ – μ): The larger the difference between your sample mean and the population mean, the larger the absolute Z-score will be, suggesting a more significant effect.
  • Population Standard Deviation (σ): A smaller population standard deviation leads to a larger Z-score, as it implies less natural variability in the population.
  • Sample Size (n): A larger sample size decreases the standard error of the mean (σ/√n). This makes the test more sensitive to differences and increases the Z-score.
  • Statistical Significance Level (α): This is the threshold you set for rejecting the null hypothesis (e.g., 0.05). It determines how unlikely your results must be to be considered significant.
  • One-Tailed vs. Two-Tailed Test: A one-tailed test is more powerful for detecting an effect in a specific direction, while a two-tailed test is used to detect an effect in either direction.
  • Data Normality: The Z-test assumes the sampling distribution of the mean is normal. This assumption is generally met if the sample size is large (n > 30) due to the Central Limit Theorem.

Frequently Asked Questions (FAQ)

What’s 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. A t-test is used when σ is unknown and must be estimated from the sample.
What is a p-value?
The p-value is the probability of observing a result as extreme as, or more extreme than, the one you got from your sample, assuming the null hypothesis is true. A small p-value (typically < 0.05) provides evidence against the null hypothesis.
What does a Z-score of 0 mean?
A Z-score of 0 means that your sample mean is exactly equal to the population mean. It is the center of the standard normal distribution.
When should I use a one-tailed vs. a two-tailed test?
Use a one-tailed test if you have a specific hypothesis about the direction of the effect (e.g., “is greater than” or “is less than”). Use a two-tailed test if you are interested in any difference from the population mean, regardless of direction (“is not equal to”).
Can I use this calculator if my population standard deviation is unknown?
No. The Z-test requires a known population standard deviation. If it is unknown, you should use a t-test. Our t-Test Calculator might be helpful.
What is considered a large sample size for a Z-test?
A common rule of thumb is that a sample size (n) of 30 or more is sufficient for the Z-test, thanks to the Central Limit Theorem ensuring normality of the sample mean distribution.
Are the input values unitless?
The values for means and standard deviation have the same units as your original data (e.g., kg, cm, IQ points). The Z-score and p-value are themselves unitless ratios and probabilities.
How do I interpret a negative Z-score?
A negative Z-score indicates that the sample mean is below the population mean. The magnitude of the Z-score still indicates the strength of the evidence; for a two-tailed test, the sign doesn’t affect significance.

Related Tools and Internal Resources

Explore other statistical tools to deepen your analysis:

© 2026 Your Website. For educational purposes only.



Leave a Reply

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