Z-Test Calculator

Perform one-sample and two-sample Z-tests for means and proportions with exact p-values, critical boundaries, and confidence intervals.

Calculation Mode
Calculation Inputs

Test if a sample mean significantly differs from a known population mean (known σ).

Auto-Computed
Statistical Visualizations & Distributions

Interactive, data-driven visualization computed from your current input values.

Standard Normal Sampling Distribution (Z)

H₀: μ = 100 vs H₁ (two-tailed). Observed Z = 2

Null Distribution H₀P-Value Area (0.0455)Critical α CutoffObserved (2.00)
-z_α/2 (-1.96)+z_α/2 (+1.96)Z: 2.00-4-2.7-1.301.32.74Z-Score (Standard Deviations)Density φ(z)
Statistical Analysis SummaryStatistically Significant
Z-Score
2
Critical Value: ±1.96
P-Valueα = 0.05
0.0455
p < 0.05 (Significant at α)
95% Conf. Interval[100.1, 109.9]
Sample Size (N)36
Standard Error (SE)2.5

Step-by-Step Mathematical Derivation

Detailed derivation with exact formulas, user input substitutions, and statistical interpretations.

Step 1

Calculate Standard Error of the Mean

Formula
SE = σ√n
Substitution & Values
SE = 15√36
Result:
SE = 2.5

The standard error quantifies the expected dispersion of sample means around the true population mean.

Step 2

Compute Mean Difference

Formula
Δ = x − μ0
Substitution & Values
Δ = 105 − 100
Result:
Δ = 5

Determines the observed difference between the sample mean and the hypothesized baseline parameter.

Step 3

Compute Z-Score Test Statistic

Formula
Z = x − μ0SE
Substitution & Values
Z = 105 − 1002.5
Result:
Z = 2

The sample mean is 2 standard errors above the hypothesized population mean.

Step 4

Calculate P-Value & Critical Values

Formula
p = 2(1 − Φ(|Z|))
Substitution & Values
Z = 2, α = 0.05
Result:
p = 0.0455, Zcrit = ±1.96

For a two-tailed test with significance threshold α = 0.05, the p-value is 0.0455. Since p < α, this result is statistically significant.

Step 5

95% Confidence Interval for Population Mean

Formula
CI = x ± Zα/2 · SE
Substitution & Values
105 ± 1.96 × 2.5
Result:
[100.1, 109.9]

We are 95% confident that the true population mean μ lies between 100.1 and 109.9.

Statistical Interpretation & Assumptions

Evaluation & Analysis Guidelines

Statistical Decision: Reject H₀ at α = 0.05 (Statistically Significant)
Required Assumptions:
  • Population standard deviation σ is known
  • Sample size n ≥ 30 or population normally distributed
  • Observations are independent

Z-Test Methodology & Formulas

Statistical formulations for one-sample and two-sample Z-tests, standard errors, and standard normal integrals.

One-Sample Mean Z-Test Formula

Z = x − μ0σ / √n

Measures how many standard errors the sample mean x̄ is away from the hypothesized mean μ₀. Valid when population standard deviation σ is known and the sample size is large (n ≥ 30) or the population is normally distributed.

Worked Example: If x̄ = 105, μ₀ = 100, σ = 15, n = 36: SE = 15/√36 = 2.5. Z = (105 - 100) / 2.5 = 2.00. P-value (two-tailed) = 0.0455. At α = 0.05, we reject H₀.

Two-Sample Independent Z-Test Formula

Z = x1 − x2√σ12n1 + σ22n2

Determines whether the difference between two population means is statistically significant when both population standard deviations σ₁ and σ₂ are known.

Worked Example: Comparing two manufacturing batches: x̄₁ = 108, x̄₂ = 100, σ₁ = 12, σ₂ = 15, n₁ = 40, n₂ = 45. Standard Error = 2.932. Z = 2.728, p = 0.0064 (Reject H₀).

One-Sample Proportion Z-Test Formula

Z = ^p − p0√p0(1−p0)n

Tests whether an observed sample proportion p̂ = x/n differs significantly from a hypothesized proportion p₀ under normal approximation conditions (np₀ ≥ 5, n(1-p₀) ≥ 5).

Worked Example: Coin tossed 100 times yields 65 heads. p₀ = 0.50. SE = √(0.5 × 0.5 / 100) = 0.05. Z = (0.65 - 0.50) / 0.05 = 3.00. Two-tailed p-value = 0.0027.

Step-by-Step Guide: Conducting One-Sample, Two-Sample & Proportion Z-Tests

Z-tests quantify how many standard errors a sample mean or proportion deviates from a null hypothesis baseline under the standard normal N(0, 1) distribution.

  1. 1

    Choose Your Test Mode (One Mean, Two Means, or One Proportion)

    Use One-Sample Mean when comparing a cohort average against a target μ₀; Two-Sample Means when comparing two independent populations with known σ₁, σ₂; or One-Proportion for binomial success counts.

  2. 2

    Specify Alternative Hypothesis Direction (Tail) & Significance α

    Select Two-tailed (≠) unless prior experimental design specifically dictates testing only an increase (Right-tailed) or decrease (Left-tailed).

  3. 3

    Compare Observed Z, P-Value & Interactive Shaded Curve

    Inspect the shaded normal tail integral directly against your orange critical boundaries (±z_crit) and review the companion confidence interval.

Standard Normal (Z) Critical Value & Rejection Threshold Reference

Exact critical Z boundaries for the three standard significance levels across two-tailed and one-tailed hypotheses.

Significance Level (α)Confidence LevelTwo-Tailed Critical Z (±)One-Tailed Critical ZDecision Threshold
α = 0.1090%±1.6449+1.2816 or −1.2816Reject H₀ if |Z| > 1.645 (2-tail)
α = 0.0595%±1.9600+1.6449 or −1.6449Reject H₀ if |Z| > 1.960 (2-tail)
α = 0.0199%±2.5758+2.3263 or −2.3263Reject H₀ if |Z| > 2.576 (2-tail)
α = 0.00199.9%±3.2905+3.0902 or −3.0902Strong confirmatory evidence

Statistical Assumptions & When NOT to Use a Z-Test

Unknown Population Standard Deviation (σ)

In real experiments, true population σ is rarely known. Whenever you estimate spread from your sample data (s) rather than known population σ, switch to the Student's / Welch's T-Test Calculator.

Small-Sample Normality Requirement

For small samples (n < 30), mean Z-tests assume the underlying population itself follows a normal distribution; proportion Z-tests require np₀ ≥ 5 and n(1 − p₀) ≥ 5.

Z-Test Calculator — Worked Examples

Real-world scenarios and verified benchmark inputs for the Z-Test Calculator.

Quality Control Mean Benchmark

Testing whether 36 precision bolts (x̄ = 105 mm, σ = 15 mm) deviate from a 100 mm target specification.

ResultZ = 2.0000, p-value = 0.04550 (Reject H₀)

Two-Batch Manufacturing Comparison

Comparing mean tensile scores across Batch A (x̄₁ = 108, σ₁ = 12, n₁ = 40) and Batch B (x̄₂ = 100, σ₂ = 15, n₂ = 45).

ResultZ = 2.7280, p-value = 0.00637 (Reject H₀)

Proportion Response Rate Test

Evaluating whether 65 favorable responses out of 100 sampled users differs significantly from a 50% baseline.

ResultZ = 3.0000, p-value = 0.00270 (Reject H₀)

Z-Test Calculator — Frequently Asked Questions

Frequently asked questions regarding Z-tests, normal assumptions, critical rejection regions, and p-values.

When should I use a Z-test instead of a T-test?

Use a Z-test when the population standard deviation (σ) is known in advance and either the population is normally distributed or the sample size is large (n ≥ 30 by the Central Limit Theorem). If σ is unknown and must be estimated from your sample standard deviation (s), use a Student's or Welch's T-test instead.

What is the difference between a one-tailed and two-tailed Z-test?

A two-tailed test checks for a statistically significant difference in either direction (above or below H₀), splitting α equally between both tails (e.g., ±1.96 at α = 0.05). A one-tailed test commits your entire significance threshold α to one pre-specified direction (e.g., +1.645 right-tailed or -1.645 left-tailed).

What sample size assumptions apply to a one-proportion Z-test?

For the normal approximation of a binomial proportion to hold accurately, check the success-failure condition under the null hypothesis: both n·p₀ ≥ 5 (or ≥ 10 for stricter benchmarks) and n·(1 − p₀) ≥ 5. For very small samples or extreme proportions near 0 or 1, exact binomial tests are preferred.

How does increasing sample size (n) change the Z-score and p-value?

Standard error equals σ / √n, so increasing n reduces the standard error and shrinks the confidence interval width. Even a small raw difference between sample mean and population mean yields a larger |Z| and smaller p-value as n grows, which is why practical significance matters alongside statistical significance.

What is the critical Z-value for 90%, 95%, and 99% confidence?

For standard two-tailed hypothesis tests, critical Z boundaries are ±1.6449 at α = 0.10 (90% confidence), ±1.9600 at α = 0.05 (95% confidence), and ±2.5758 at α = 0.01 (99% confidence).

Why does the one-proportion confidence interval differ slightly from the Z-test SE?

When testing H₀: p = p₀, the standard error is computed using the null hypothesized proportion p₀ because we evaluate surprise under the assumption H₀ is true. When building a confidence interval around the observed estimate, standard error uses the sample proportion p̂.

Related Calculators

Explore connected statistics & probability and related computation tools.

Browse all Statistics & Probability calculators
Statistics & Probability

T-Test Calculator

Available
Statistics & Probability

P-Value Calculator

Available
Statistics & Probability

Confidence Interval Calculator

Available
Available