statistics calculators

Hypothesis Test Calculator

Compute a z-score or t-statistic to determine whether your sample mean differs significantly from a hypothesized population mean. Use it for quality control checks, clinical trials, and any experiment where you need to accept or reject a null hypothesis.

About this calculator

Hypothesis testing evaluates whether an observed sample result is likely under an assumed null hypothesis (H₀). The test statistic is computed as |z| or |t| = |( x̄ − μ₀ ) / ( σ / √n )|, where x̄ is the sample mean, μ₀ is the hypothesized population mean, σ is the standard deviation, and n is the sample size. For large samples or known population variance, a z-test is appropriate; for small samples with unknown variance, a t-test is preferred. The resulting statistic is compared to a critical value at your chosen significance level (e.g., 1.96 for α = 0.05 two-tailed). If the test statistic exceeds the critical value, you reject H₀ and conclude the difference is statistically significant. The smaller the p-value, the stronger the evidence against the null hypothesis.

How to use

A factory claims its bolts have a mean diameter of 10 mm (μ₀ = 10). A quality inspector measures a sample of 49 bolts, finding x̄ = 10.3 mm with σ = 0.7 mm. Step 1: Compute the test statistic: |z| = |( 10.3 − 10 ) / ( 0.7 / √49 )| = |0.3 / 0.1| = 3.0. Step 2: Compare to the critical value of 1.96 (α = 0.05, two-tailed). Step 3: Since 3.0 > 1.96, reject H₀. The data provide strong evidence that the true mean diameter differs from 10 mm.

Frequently asked questions

What is the difference between a z-test and a t-test in hypothesis testing?

A z-test is used when the population standard deviation is known or the sample size is large (typically n ≥ 30), because the sampling distribution is well approximated by a normal curve. A t-test is used when the population standard deviation is unknown and the sample is small, relying on the t-distribution which has heavier tails to account for extra uncertainty. As sample size grows, the t-distribution converges to the normal distribution, so the two tests produce nearly identical results for large n. In practice, the t-test is safer when in doubt.

How do I interpret the p-value from a hypothesis test?

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) indicates that your result would be unlikely by chance alone, providing evidence to reject H₀. It is not the probability that H₀ is true, nor the probability your result occurred by chance. Crossing the 0.05 threshold is a convention, not a hard rule — context, effect size, and study design all matter when drawing conclusions.

What does it mean when a hypothesis test result is statistically significant?

Statistical significance means the test statistic exceeds the critical threshold for your chosen significance level, suggesting the observed difference is unlikely due to random sampling variation alone. It does not necessarily mean the difference is practically important or large. A study with a very large sample can detect tiny, trivial differences as statistically significant. Always pair significance with effect size measures (like Cohen's d) and confidence intervals to judge whether a finding has real-world relevance.