Hypothesis Test Calculator
One-sample z/t style test with approximate p-value.
About this tool
Enter a sample mean, the hypothesised mean, the SD, n and α for a two-sided test. A mean of 52 against 50 with SD 4 and n = 36 gives z = 3, p ≈ 0.0027 and rejects H₀.
How to use
How it works
The statistic is (x̄ − μ₀) ÷ (s ÷ √n). The two-sided p-value is the chance of a result at least this extreme if H₀ is true. With the z option the p-value and cut-off come from the normal distribution (1.96 at α = 0.05). With the t option they come from Student's t distribution with n − 1 degrees of freedom, which is shown in the result. If |statistic| exceeds the critical value for α, H₀ is rejected.
z or t = (x̄ − μ₀) ÷ (s ÷ √n) reject H₀ if |stat| > critical value at α/2 t uses df = n − 1
Worked example
A result that is not significant
- Input
- x̄ = 50.5, μ₀ = 50, SD = 4, n = 36, α = 0.05
- Output
- z = 0.75, p ≈ 0.453254: fail to reject H₀
- Walkthrough
- Standard error = 4 ÷ 6 = 0.6667, so z = 0.5 ÷ 0.6667 = 0.75. That is well inside ±1.96.
Limitations
- Two-sided only.
- The z option uses the normal distribution, so for a small sample with an estimated SD choose t. For x̄ = 52, μ₀ = 50, SD = 4, n = 16 the t option gives t = 2 with df = 15, p = 0.0639, and does not reject at 0.05, while the z option would give p = 0.0455 and reject.
- Needs n of at least 2 and SD above 0.
Questions
What is the z statistic for mean 52, μ₀ = 50, SD 4, n = 36?
What is the result for mean 50.5 with the same SD and n?
Should I use this for a small sample with unknown SD?
What is the t result for mean 52, μ₀ = 50, SD 4, n = 36?
Features
- Statistic, p-value and decision
- z or Student t with df
- Adjustable α
- Runs in your browser
Guides
Related resources
Guides and videos from around the web—opens on YouTube or the publisher’s site.
Vectors | Essence of linear algebra
3Blue1Brown
Linear algebra intuition for matrix and vector tools.
Watch on YouTubeStandard Deviation vs Standard Error
StatQuest with Josh Starmer
Avoids mixing SD and SE when reading results panels.
Watch on YouTube
- Standard Deviation and Variance
Math is Fun
Worked SD formulas that match sample/population toggles.
- Math is Fun
Math is Fun
Clear explainers that pair well with calculator-style tools.