Hypothesis Testing Calculator
Perform one-sample hypothesis testing with z-test or t-test, critical values, p-values, and accept or reject decisions.
What Is Hypothesis Testing?
Hypothesis testing is a statistical method for deciding whether sample data provides enough evidence to reject a null hypothesis ($H_0$) in favor of an alternative hypothesis ($H_1$). This calculator performs one-sample z-tests (for $n \geq 30$) and t-tests (for smaller samples) with critical values and p-values. For critical value lookup, see the Critical Value Calculator.
Key Formulas
The test statistic for a one-sample mean test is:
$$z = \frac{\bar{x} - \mu_0}{s / \sqrt{n}} \quad \text{or} \quad t = \frac{\bar{x} - \mu_0}{s / \sqrt{n}}$$
Reject $H_0$ when the p-value is less than the significance level $\alpha$, or when the test statistic falls in the rejection region defined by critical values.
Example: Factory Weight Claim
A factory claims average product weight is 500 g. A sample of 30 products has mean 495 g and standard deviation 10 g. At $\alpha = 0.05$ with a two-tailed test: $z = (495 - 500) / (10 / \sqrt{30}) \approx -2.74$. Since $|z| > 1.96$, we reject $H_0$ and conclude the mean weight differs from 500 g.
Frequently Asked Questions
When should I use a z-test vs a t-test?
Use a z-test when the sample size is at least 30 and the population standard deviation is known or well estimated. Use a t-test for smaller samples where the t-distribution better accounts for estimation uncertainty.
What is the significance level (α)?
$\alpha$ is the probability of rejecting a true null hypothesis (Type I error). Common values are 0.05 (5%) and 0.01 (1%).
What is a p-value?
The p-value is the probability of observing a test statistic at least as extreme as the one calculated, assuming $H_0$ is true. A small p-value provides evidence against $H_0$.
What is the difference between one-tailed and two-tailed tests?
A two-tailed test checks whether the parameter differs from $\mu_0$ in either direction. A one-tailed test checks only whether it is less than or greater than $\mu_0$.
What does "fail to reject H₀" mean?
It means the sample data did not provide sufficient evidence at the chosen $\alpha$ level to conclude the null hypothesis is false. It does not prove $H_0$ is true.