# Z-Test Calculator

Free z-test calculator. Perform one-sample or two-sample z-tests with known population standard deviations. Get the z-statistic, p-value, and significance result.

## What this calculates

Perform a one-sample or two-sample z-test when the population standard deviation is known. Enter your sample statistics, choose your tail type, and get the z-statistic and p-value instantly.

## Inputs

- **Test Type** — options: One-Sample Z-Test, Two-Sample Z-Test — One-sample tests a sample mean against a known value. Two-sample compares two sample means.
- **Tail Type** — options: Two-Tailed, Left-Tailed, Right-Tailed — Two-tailed tests for any difference. One-tailed tests for a specific direction.
- **Sample Mean (x̄)** — The mean of your sample (or sample 1 for two-sample).
- **Population Std Dev (σ)** — min 0.0001 — Known population standard deviation (or for sample 1).
- **Sample Size (n)** — min 1 — Number of observations (or sample 1 size).
- **Hypothesized Mean (μ₀) / Sample 2 Mean** — For one-sample: hypothesized population mean. For two-sample: mean of sample 2.
- **Sample 2 Std Dev (σ₂)** — min 0.0001 — Known population standard deviation for sample 2 (two-sample only).
- **Sample 2 Size (n₂)** — min 1 — Number of observations in sample 2 (two-sample only).
- **Significance Level (α)** — min 0.001, max 0.5 — Threshold for statistical significance (typically 0.05).

## Outputs

- **Z-Statistic** — The calculated z-test statistic.
- **P-Value** — The p-value for the test.
- **Standard Error** — The standard error of the mean difference.
- **Statistically Significant?** — formatted as text — Whether the result is significant at the chosen alpha level.
- **Summary** — formatted as text — Step-by-step calculation summary.

## Details

A z-test is a hypothesis test that uses the standard normal distribution. It is appropriate when the population standard deviation is known and the sample size is large enough (typically n > 30).

**One-Sample Z-Test:**
z = (x̄ - μ₀) / (σ / √n)

Tests whether a sample mean differs significantly from a hypothesized population mean.

**Two-Sample Z-Test:**
z = (x̄₁ - x̄₂) / √(σ₁²/n₁ + σ₂²/n₂)

Tests whether two population means are different.

**Choosing a Tail Type:**

- **Two-tailed:** Tests if the means are different in either direction (H₁: μ ≠ μ₀)
- **Left-tailed:** Tests if the mean is less than the hypothesized value (H₁: μ  μ₀)

**When to Use a Z-Test vs. T-Test:**
Use a z-test when you know the population standard deviation. Use a t-test when you only have the sample standard deviation (which is almost always the case in practice).

## Frequently Asked Questions

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

A: Use a z-test when the population standard deviation is known and your sample size is large (n > 30). In practice, the population standard deviation is rarely known, so t-tests are more common. When n is large, the z-test and t-test give nearly identical results.

**Q: What does the p-value tell me?**

A: The p-value is the probability of observing a test statistic as extreme as yours (or more extreme) assuming the null hypothesis is true. A small p-value (typically below 0.05) suggests the data is unlikely under the null hypothesis, so you reject it.

**Q: What is the difference between one-tailed and two-tailed tests?**

A: A two-tailed test checks for any difference (greater or less). A one-tailed test only checks one direction. Use a one-tailed test when you have a specific directional hypothesis before collecting data. Two-tailed tests are more conservative and more common.

**Q: Can I use a z-test with small samples?**

A: Technically yes, if the population standard deviation is known and the population is normally distributed. However, with small samples, even slight departures from normality can affect results. A t-test is more robust for small samples.

---

Source: https://vastcalc.com/calculators/statistics/z-test
Category: Statistics
Last updated: 2026-04-08
