Hypothesis test calculator for a mean

Test a sample mean against a reference value with a Z or Student t test and get the p-value instantly.

Your data

🔒 Your data is processed in your browser and never sent to a server.

Result

p = 0.0569

Statistic t2
Degrees of freedom24
Fail to reject H₀

The data does not provide enough evidence against H₀ at α = 0.05.

Two-sided test. A statistical decision does not prove causation or practical importance.

What is a hypothesis test for a mean?

It is a procedure to decide whether a sample mean is compatible with an assumed value (H₀). Use the Z test when the population standard deviation is known and the Student t test when you estimate it from the sample.

How to use the calculator

  1. Choose the test: Student t (most common) or Z.
  2. Enter your sample mean and the mean under H₀.
  3. Enter the standard deviation and the sample size.
  4. Pick the significance level α and read the p-value and conclusion.

Test statistic formula

t = (x̄ − μ₀) / (s / √n) p = P(|T| ≥ |t|)

The test is two-sided. The Student t test uses n − 1 degrees of freedom. If p < α, reject H₀.

Example

With a sample mean of 52.1, H₀: μ = 50, s = 5 and n = 25, the t statistic is 2.1 with 24 degrees of freedom. The p-value is below 0.05, so H₀ is rejected at the 5% level.

Frequently asked questions

What does the p-value mean?

It is the probability of a result at least as extreme as the one observed if H₀ were true. It is not the probability that H₀ is true.

When do I use Z vs. t?

Use Z if you know the population standard deviation. If you computed it from your sample, use the Student t test.

Does rejecting H₀ prove my hypothesis?

No. It shows statistical evidence against H₀, but it does not measure practical importance or prove causation.

More calculators