Z-Test Calculator

One- and two-sample z-tests against a known population standard deviation, with APA write-up.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

About this tool

Paste one or two samples and enter the known population standard deviation. The z-test returns z, the p-value, the mean difference, a confidence interval and Cohen's d.

How to use

1
Step 1
Choose one-sample or two-sample.
2
Step 2
Enter the data, σ₁ (and σ₂), the null value, tail and confidence level.
3
Step 3
Press Calculate.

How it works

Use a z-test when the population standard deviation is known or the sample is large enough that it is well estimated. If you only have the sample standard deviation from a small sample, a t-test is the right choice because it allows for the extra uncertainty.

two-sample: z = (x̄₁ − x̄₂) ÷ √(σ₁²/n₁ + σ₂²/n₂)      one-sample: z = (x̄ − μ₀) ÷ (σ/√n)

Worked example

Two groups, known σ = 5

Input
A: 101,98,105,99,103,97,102,100 B: 95,99,94,97,96,93,98,95
Output
z = 1.90, p = .057; mean difference 4.75; 95% CI [−0.15, 9.65]
Walkthrough
Means 100.625 and 95.875, difference 4.75. SE = 5 × √(2/8) = 2.5, so z = 4.75 ÷ 2.5 = 1.90.

Limitations

  • σ must be supplied; the tool does not estimate it for you.
  • Assumes independent, approximately normal data.

Questions

When do I use a z-test instead of a t-test?
When σ is known, or n is large. Otherwise use a t-test.
What does z = 1.90 mean?
The difference is 1.9 standard errors from zero; two-tailed p is.057.
What is the one-sample result for 52,48,55,51,49,53,50,54 with σ = 4 and μ₀ = 50?
z = 1.06, p =.289; sample mean 51.5.

Features

  • One and two sample
  • Confidence interval
  • Cohen's d

Guides

Related resources

Guides and videos from around the web—opens on YouTube or the publisher’s site.

  • Chi-square distribution introduction

    Khan Academy

    Background for χ² tables and GoF/independence tools.

    Watch on YouTube
  • Hypothesis testing and p-values

    StatQuest with Josh Starmer

    Intuition for t/z/χ² decision rules.

    Watch on YouTube