Skip to content
CalculatorAtlas

One-Sample Z-Test Calculator

Tested

Z-test for a mean with known population standard deviation.

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

Results

Enter your values and press Calculate. Results appear here.

  • • Result

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

  1. Enter sample mean.
  2. Enter hypothesised mean.
  3. Enter population σ (above 0).
  4. Enter sample size (a whole number, 1 or more).
  5. Choose test type: Two-tailed, Left-tailed and Right-tailed.
  6. Press Calculate to see the result, and use Reset to start again.
Inputs of the One-Sample Z-Test Calculator
InputWhat to enterAllowed values
Sample meanA number—
Hypothesised meanA number—
Population σA number> 0
Sample sizeA whole number≥ 1
Test typeChoose one: Two-tailed; Left-tailed; Right-tailedStarts 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.

Results of example 1
ResultValue
z statistic2
p-value0.0455
Standard error1

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.

How the result changes with sample mean
Sample meanz statisticp-valueStandard error
26-2401
5220.04551
1045401
20815801

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.

Choosing between the One-Sample Z-Test Calculator and similar calculators
CalculatorYou enterIt returns
[One-Sample T-Test Calculator](/statistics/t-test-calculator/)sample mean, hypothesised mean and sample standard deviationt statistic
[One-Way ANOVA Calculator](/statistics/anova-calculator/)groupsF statistic
[P-Value Calculator](/statistics/p-value/)test statistic, statistic value and test typep-value
[T Statistic Calculator](/statistics/t-statistic/)sample mean, hypothesised mean and sample standard deviationt statistic
[Critical Value Calculator](/statistics/critical-value/)distribution, significance level and tailsCritical 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.

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.