About the Hypothesis Test Calculator
What is the Hypothesis Test Calculator?
A hypothesis test checks whether sample data provide enough evidence against a default claim, the null hypothesis H₀ — for example, that the average weight of a product equals 100 g. The p-value is the probability of getting a result at least as extreme as yours if H₀ were true.
This calculator runs a one-sample z-test, used when the population standard deviation σ is known (or the sample is large). Choose a two-tailed test to detect any difference, or a left- or right-tailed test when you only care about one direction, and pick a significance level α.
How to use the Hypothesis Test Calculator
- Sample Mean (x̄) (sample: 105)
- Hypothesised Mean (μ₀) (sample: 100)
- Population Standard Deviation (σ) (sample: 15)
- Sample Size (n) (sample: 36)
- Alternative Hypothesis — two-tailed tests for any difference; one-tailed tests for a specific direction chosen before seeing the data. (sample: Two-tailed (≠))
- Significance Level (α) — the risk of rejecting H₀ when it is actually true; 0.05 is the usual choice. (sample: 0.05 (5%))
- Press Run Test (results also refresh as you type). The result card shows the p-value, along with Test statistic (z), Critical value (±), Standard error and Decision.
Formula used
z = (x̄ − μ₀) ÷ (σ ÷ √n)
- x̄ = the sample mean
- μ₀ = the mean under the null hypothesis
- σ = the population standard deviation
- n = the sample size
Two-tailed p-value = 2 × (1 − Φ(|z|)); right-tailed = 1 − Φ(z); left-tailed = Φ(z), where Φ is the standard normal CDF. Reject H₀ when p < α.
Worked example
These are the sample values already filled in the calculator above, and the result it returns for them:
| Input | Sample value |
|---|---|
| Sample Mean (x̄) | 105 |
| Hypothesised Mean (μ₀) | 100 |
| Population Standard Deviation (σ) | 15 |
| Sample Size (n) | 36 |
| Alternative Hypothesis | Two-tailed (≠) |
| Significance Level (α) | 0.05 (5%) |
| Result | Value |
|---|---|
| p-value | 0.0455 |
| Test statistic (z) | 2 |
| Critical value (±) | 1.96 |
| Standard error | 2.5 |
| Decision | Reject H₀ (significant at α = 0.05) |
Tips for using the Hypothesis Test Calculator
- If σ is unknown and the sample is small, use the T-Test Calculator instead.
- “Fail to reject H₀” does not prove H₀ is true — it means the evidence is not strong enough.
- Statistical significance is not the same as practical importance; with a huge sample even tiny differences become significant.
