One-Sample Z-Test Calculator

This z test calculator runs a one-sample z-test for a mean: enter the sample mean, the hypothesised mean, the known population standard deviation and the sample size to get the z-statistic, p-value, critical value and a reject or fail-to-reject decision.

Must be known. If it is not, use a t-test instead.

Checks on your data

  • The z-test requires the population standard deviation σ to be known. If you estimated it from this sample, use a t-test instead. Use a t-test →

Results

z-statistic
2
p-value
0.0455
Decision
Reject H₀ (p < α)
Critical values
-1.96 and 1.96
Standard error (σ/√n)
2.5
95% confidence interval for μ
(100.1, 109.9)
Two-sided, same α
Effect size (Cohen's d = (x̄ − μ₀) ÷ σ)
0.3333 (small)
practical size of the difference
Observed power (if the true mean equals x̄)
51.6 %
probability of detecting this difference
Reporting sentence
A one-sample z-test showed a significant difference from μ₀ = 100: z = 2, p = .0455, 95% CI [100.1, 109.9].
Standard normal curve: your z-statistic and rejection region
-3-2-10123z = 2Rejection region
Sampling distribution of the mean under H₀, with your sample mean marked
9095100105110x̄ = 105Sample mean
Decision summary
ItemValue
Null hypothesisμ = μ₀
Alternative hypothesisμ ≠ μ₀
Test statistic z2
p-value0.0455
α0.05
ConclusionReject H₀
Show step-by-step solution
  1. State the hypotheses: H₀: μ = μ₀ and H₁: μ ≠ μ₀, with μ₀ = 100 and α = 0.05.
  2. Standard error: σ ÷ √n = 15 ÷ √36 = 2.5.
  3. Test statistic: z = (x̄ − μ₀) ÷ SE = (105 − 100) ÷ 2.5 = 2.
  4. p-value (two-tailed): 2 × P(Z ≥ |z|) = 0.0455.
  5. Critical values at α = 0.05: -1.96 and 1.96.
  6. Because p = 0.0455 is less than α = 0.05 (and z falls in the rejection region), reject H₀.
Use whenσ is known (or n is large)
Statisticz = (x̄ − μ₀) ÷ (σ/√n)
DecisionReject H₀ if p < α
Alternativet-test when σ unknown

What Is Z-Test?

A z-test checks whether a sample mean differs from a claimed population mean when the population standard deviation (σ) is known. The test statistic is the distance between the sample mean and the claimed mean, measured in standard errors, and the p-value is the chance of a result at least that extreme if the claimed mean were true.

Choose a two-tailed, left-tailed or right-tailed test and your significance level α. The calculator returns the z score and p-value, the critical value, the standard error, a confidence interval for the mean and a ready-to-use reporting sentence. If σ is unknown and has to be estimated from the sample, use a t-test instead, as explained below.

The sections that follow cover the z-test formula, a table of variables, a worked hypothesis test, the assumptions to check and answers to common questions such as one-tailed versus two-tailed tests.

How to Use the Z-Test Calculator

  1. Enter the sample mean, the hypothesised mean μ₀, the known population standard deviation σ and the sample size n.
  2. Pick the significance level (0.05 is the most common) and the alternative hypothesis: two-tailed to detect any difference, or right/left-tailed to detect an increase or decrease only.
  3. Read the decision. If the p-value is smaller than α, the result is statistically significant and you reject the null hypothesis.

Z-Test Formula

Standard error

SE=σnSE=\frac{\sigma}{\sqrt{n}}

Z-statistic

z=xˉ−μ0σ/nz=\frac{\bar{x}-\mu_0}{\sigma/\sqrt{n}}

Confidence interval for the mean

xˉ±zα/2⋅σn\bar{x}\pm z_{\alpha/2}\cdot\frac{\sigma}{\sqrt{n}}
Common critical values of z
Significance level αTwo-tailed critical zOne-tailed critical z
0.10± 1.6451.282
0.05± 1.9601.645
0.01± 2.5762.326
0.001± 3.2913.090

Z-Test Variables Explained

SymbolMeaningNotes
x̄Sample meanAverage of your sample
μ₀Hypothesised population meanThe value stated by the null hypothesis
σPopulation standard deviationMust be known, not estimated from the sample
nSample sizeLarger n gives a smaller standard error
σ/√nStandard error of the meanSpread of sample means
αSignificance levelThe p-value cut-off, chosen before you test

Z-Test Worked Example

Using the example values (press “Load example” above to try them):

  1. State the hypotheses: H₀: μ = μ₀ and H₁: μ ≠ μ₀, with μ₀ = 100 and α = 0.05.
  2. Standard error: σ ÷ √n = 15 ÷ √36 = 2.5.
  3. Test statistic: z = (x̄ − μ₀) ÷ SE = (105 − 100) ÷ 2.5 = 2.
  4. p-value (two-tailed): 2 × P(Z ≥ |z|) = 0.0455.
  5. Critical values at α = 0.05: -1.96 and 1.96.
  6. Because p = 0.0455 is less than α = 0.05 (and z falls in the rejection region), reject H₀.

Result: z-statistic = 2; p-value = 0.0455; Decision = Reject H₀ (p < α).

The z-test, step by step

  • State H₀ (μ = μ₀) and H₁ (≠, > or <).
  • Choose α, usually 0.05.
  • Compute the standard error σ/√n and the z-statistic.
  • Find the p-value from the standard normal curve (or compare z with the critical value).
  • Compare p with α, state the decision and interpret it in context.

Assumptions of the z-test

  • The sample is random and the observations are independent.
  • σ is known from a long history of data or theory.
  • The population is normal, or n is large (roughly 30 or more) so the central limit theorem applies.
  • No extreme outliers when n is small.

Interpreting the result

A small p-value means the observed difference would be rare if H₀ were true. It does not give the probability that H₀ is true, and it does not measure how large the effect is. That is why the calculator also reports Cohen’s d, the difference measured in σ units, and a confidence interval.

Power is the probability of correctly rejecting H₀ when the true mean equals your sample mean. A low observed power on a non-significant result is a warning that the sample may have been too small to detect the difference, so “no significant difference” is not the same as “no difference”.

Cohen’s d guidelines
dSizeExample
0.2SmallSubtle shift, hard to see by eye
0.5MediumVisible to a careful observer
0.8LargeObvious difference

Critical values of z

Rejection regions
AlternativeReject H₀ ifAt α = 0.05
Two-tailed (≠)|z| > z(1 − α/2)|z| > 1.960
Right-tailed (>)z > z(1 − α)z > 1.645
Left-tailed (<)z < −z(1 − α)z < −1.645

Where Z-Test Is Used

Checking a process against a target

Testing whether the mean of a measured output differs from a specification when long-run variability is known.

Course and exam problems

Standard hypothesis-testing exercises that give σ in the question.

Large-sample comparisons

Testing a mean against a benchmark when σ is known from earlier data.

Finding critical values

Reading the z critical value and rejection region for a chosen α and tail.

Common Z-Test Mistakes to Avoid

  • Using a z-test with the sample standard deviation when n is small; use a t-test.
  • Choosing a one-tailed test after seeing the direction of the data.
  • Treating p > 0.05 as proof of no effect.
  • Confusing the standard deviation of the data with the standard error of the mean.
  • Confusing statistical significance with practical importance.
  • Use a z-test only when σ is known. When you only have the sample standard deviation, use a t-test.
  • A significant result tells you the difference is unlikely to be due to chance. It does not tell you the difference is large or important.
  • Decide on one-tailed or two-tailed before looking at the data, not after.

Z-Test Terms and Definitions

Null hypothesis (H₀)
The default claim that there is no difference or effect.
Alternative hypothesis (H₁)
The claim you look for evidence of.
p-value
The probability of a result at least this extreme if H₀ is true.
Significance level (α)
The cutoff probability for rejecting H₀, set in advance.
Standard error
The standard deviation of the sample mean, σ/√n.
Power
The probability of rejecting H₀ when it is false.

Z-Test FAQs

What is a one-sample z-test?

A test of whether a sample mean differs from a specified population mean when the population standard deviation is known.

How do I calculate the z-score for a sample mean?

z = (x̄ − μ₀) ÷ (σ ÷ √n). The calculator shows the arithmetic with your numbers.

What is the critical value for α = 0.05?

1.96 for a two-tailed test and 1.645 for a one-tailed test.

Can I use a z-test if I do not know σ?

With a large sample (n of 30 or more) the sample SD is a good estimate and the z-test is a fair approximation, but the t-test is more accurate and recommended.

What does the confidence interval tell me?

A range of plausible values for the true mean. If it excludes μ₀ in a two-tailed test, the result is significant at the same α.

What does power mean here?

The chance of detecting a difference as large as the one observed. Aim for at least 80 % when planning a study.

How is this different from a two-sample z-test?

A one-sample test compares one mean with a fixed value. A two-sample test compares two groups with each other.

When should I use a z-test instead of a t-test?

Use a z-test when the population standard deviation is known. Use a t-test when you have to estimate it from the sample, which is the usual situation, especially with small samples.

What does the p-value mean?

It is the probability of getting a sample mean at least as far from μ₀ as yours if the null hypothesis were true. A small p-value is evidence against the null hypothesis.

What is a good significance level?

α = 0.05 is the convention in most fields. Use a smaller value such as 0.01 when a false positive would be costly.

How do I choose between one-tailed and two-tailed?

Use a two-tailed test if a difference in either direction matters. Use a one-tailed test only if you have a strong reason, set before collecting data, to look for a change in one direction.

What does "fail to reject the null hypothesis" mean?

It means the data do not provide enough evidence of a difference. It does not prove the null hypothesis is true.

Related calculators

T-Test Calculator: One-Sample, Two-Sample (Welch), Paired with Steps

Run a one-sample, paired or two-sample t-test from raw data or summary statistics. You get the t statistic, p-value, confidence interval, effect size and a ready-to-paste APA sentence.

Z Test Statistic Calculator: z-Score, Mean, Proportion, Two Proportions

Compute the z test statistic for a single value, a sample mean, a proportion or the difference of two proportions, with all the p-values you may need.

Hypothesis Testing Calculator with Steps (z, t and Proportion Tests)

Work through a hypothesis test step by step. Enter your sample summary and get hypotheses, test statistic, p-value, critical value, interval and a conclusion in words.

P-Value from Chi-Square Calculator (χ², df) with Critical Value Table

Convert a chi-square statistic and its degrees of freedom into an exact p-value, with the critical value, a shaded graph and a reference table.

Confidence Interval Calculator for a Mean or Proportion (t, z, Wilson)

Calculate a confidence interval for a mean or a proportion. Choose the right method, see the margin of error and compare methods side by side.

Z-Table Calculator: Z-Score to Probability and Back (Normal Distribution)

Look up standard normal probabilities without a printed table. Go from a z-score or a raw value to areas, or from a probability back to z.

Statistical Significance Calculator for A/B Tests (Two Proportions)

Check whether the difference between two conversion rates is statistically significant, with p-value, uplift, confidence interval and power.

Level of Significance (Alpha) Calculator: Critical Values, Type I/II Error, Power

See what your chosen significance level α means: critical values, the rejection region, the Type I error rate and, optionally, the power and Type II error for a given effect size and sample size.

Last updated 2026-11-09. See our disclaimer.