Quick answer
The one-sample z-test uses z = (x̄ − μ₀) ÷ (σ ÷ √n) when the population σ is known. With x̄ = 52, μ₀ = 50, σ = 10 and n = 100, z = 2 and the two-tailed p-value is 0.0455.
Enter the sample mean, hypothesised mean, population σ, sample size and test type. The calculator returns z, the p-value and the standard error.
Related tools: One-Sample T-Test Calculator: One-sample t-test from summary statistics. One-Way ANOVA Calculator: One-way analysis of variance across groups. P-Value Calculator: P-value from a z, t, chi-square or F statistic.
How to use the One-Sample Z-Test Calculator
- Enter sample mean.
- Enter hypothesised mean.
- Enter population σ (above 0).
- Enter sample size (a whole number, 1 or more).
- Choose test type: Two-tailed, Left-tailed and Right-tailed.
- Press Calculate to see the result, and use Reset to start again.
| Input | What to enter | Allowed values |
|---|---|---|
| Sample mean | A number | — |
| Hypothesised mean | A number | — |
| Population σ | A number | > 0 |
| Sample size | A whole number | ≥ 1 |
| Test type | Choose one: Two-tailed; Left-tailed; Right-tailed | Starts at Two-tailed |
Formula and method
Formula
z = (x̄ − μ₀) ÷ (σ ÷ √n)
IEEE-754 double precision; shown to at most 6 decimal places.
p-value from the standard normal distribution for the chosen tail.
Worked examples
This example is verified: each one is an automated test case that the live calculator must reproduce exactly.
Example 1
Inputs: Sample mean = 52; Hypothesised mean = 50; Population σ = 10; Sample size = 100; Test type = Two-tailed.
| Result | Value |
|---|---|
| z statistic | 2 |
| p-value | 0.0455 |
| Standard error | 1 |
The first line is the headline result (z statistic). Below it the one-Sample Z-Test Calculator lists p-value and standard error, which describe the same case from other angles. IEEE-754 double precision; shown to at most 6 decimal places.
Worked example
SE = 10 ÷ 10 = 1, so z = 2. Since |z| = 2 > 1.96, the result is significant at 5%: the sample mean differs from 50.
When to use
Use the z-test when σ is known (rare) or n is large. Otherwise use the t-test. σ must be positive and n at least 1.
How the result changes with sample mean
Holding every other input at the first worked example, this table changes only sample mean. It shows how sensitive the answer is to that one value; each row was produced by running this calculator.
| Sample mean | z statistic | p-value | Standard error |
|---|---|---|---|
| 26 | -24 | 0 | 1 |
| 52 | 2 | 0.0455 | 1 |
| 104 | 54 | 0 | 1 |
| 208 | 158 | 0 | 1 |
What happens with invalid input
These messages are produced by the calculator itself, so you know what to fix.
- Population σ: entering "0" shows "Population σ must be greater than 0." beside that field and no result.
Choosing between the One-Sample Z-Test Calculator and similar calculators
Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.
| Calculator | You enter | It returns |
|---|---|---|
| [One-Sample T-Test Calculator](/statistics/t-test-calculator/) | sample mean, hypothesised mean and sample standard deviation | t statistic |
| [One-Way ANOVA Calculator](/statistics/anova-calculator/) | groups | F statistic |
| [P-Value Calculator](/statistics/p-value/) | test statistic, statistic value and test type | p-value |
| [T Statistic Calculator](/statistics/t-statistic/) | sample mean, hypothesised mean and sample standard deviation | t statistic |
| [Critical Value Calculator](/statistics/critical-value/) | distribution, significance level and tails | Critical value |
Background: hypothesis testing and inference
A hypothesis test compares a test statistic with what the null hypothesis predicts. The decision rule is to reject the null hypothesis when the p-value is at or below the significance level α, which you should choose before seeing the data (0.05 is conventional, not special). For a two-tailed z test the p-value is 2 × (1 − Φ(|z|)); for a one-sample t test the statistic is (x̄ − μ₀) ÷ (s ÷ √n) with n − 1 degrees of freedom.
Failing to reject the null hypothesis does not prove it true, and a statistically significant result can still be too small to matter in practice.
Assumptions and limitations
- σ known and n ≥ 1
If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for population σ to confirm this.
Frequently asked questions
What is the critical z at 5%?
At 5% significance the two-tailed critical z value is ±1.96.
What is the one-tailed p here?
The one-tailed p-value for z = 2 is 0.0228, half the two-tailed 0.0455.
How is it different from t?
The z-test uses a known population σ; the t-test estimates σ from the sample, giving wider tails for small samples.
What does the One-Sample Z-Test Calculator calculate?
Z-test for a mean with known population standard deviation. It returns z statistic, p-value and Standard error.
What formula does the One-Sample Z-Test Calculator use?
z = (x̄ − μ₀) ÷ (σ ÷ √n). p-value from the standard normal distribution for the chosen tail.
What do I need to enter in the one-Sample Z-Test Calculator?
You enter Sample mean, Hypothesised mean, Population σ, Sample size and Test type.
How is the result rounded or limited?
IEEE-754 double precision; shown to at most 6 decimal places. σ known and n ≥ 1.
What does the “Test type” option change?
It sets how the one-Sample Z-Test is worked out. The choices are Two-tailed, Left-tailed and Right-tailed.
What is an example of a one-Sample Z-Test result?
With sample mean 52, hypothesised mean 50, population σ 10, sample size 100 and test type Two-tailed, the z statistic is 2.
Related calculators
- One-Sample T-Test Calculator — One-sample t-test from summary statistics.
- One-Way ANOVA Calculator — One-way analysis of variance across groups.
- P-Value Calculator — P-value from a z, t, chi-square or F statistic.
- T Statistic Calculator — t statistic from summary statistics.
- Critical Value Calculator — Critical values for z, t, chi-square and F distributions.
- Degrees of Freedom Calculator — Degrees of freedom for one- and two-sample t-tests.
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods (itl.nist.gov/div898/handbook)
- Standard textbook definitions (e.g. Moore, McCabe & Craig, Introduction to the Practice of Statistics)
Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.