Key Points
- Hypothesis testing starts from a null hypothesis, H₀, that there is no effect, and asks whether the data give strong evidence against it.
- The p-value is the probability of results at least as extreme as those observed, assuming H₀ is true.
- If the p-value is at most the significance level α, usually 0.05, H₀ is rejected; otherwise it is not rejected.
- A test can be one-tailed or two-tailed, depending on whether the alternative hypothesis specifies a direction.
- Rejecting a true H₀ is a Type I error, and failing to reject a false H₀ is a Type II error.
Is the Difference Real or Just Chance?
A cereal company claims 500 g per box, and a sample averaging 497 g raises a question.
Is the 3 g gap a sign that boxes are underfilled, or the ordinary variation of a small sample? Hypothesis testing answers questions like this with a clear rule, and it is the main tool of inferential statistics.

What Is Hypothesis Testing?
Hypothesis testing is a method for judging a claim about a population using a sample. It has two competing statements.
The null hypothesis, , says there is no effect or no difference, such as . The alternative, , says there is, such as . The test assumes and asks how surprising the data would be if it were true.
Try It Yourself
Use the hypothesis test explorer to see Hypothesis Testing at work: drag, change the numbers and watch what happens.
What Is a p-Value?
The p-value is the probability, assuming is true, of getting a result at least as extreme as the one observed.

A small p-value means the data would be unusual under . If , the result is called statistically significant and is rejected. A large p-value means the data are consistent with , so it is not rejected.
What Are One-Tailed and Two-Tailed Tests?
The alternative hypothesis decides where the evidence is looked for.

If says "different", the test is two-tailed and the significance level is split between both tails. If says "greater" or "less", the test is one-tailed. The direction must be chosen before looking at the data.
What Errors Can a Hypothesis Test Make?
Two kinds.

A Type I error rejects a true ; its probability is . A Type II error fails to reject a false . Lowering reduces Type I errors but makes Type II errors more likely, unless the sample size grows.
Examples of Hypothesis Testing
Example 1
Boxes are claimed to hold 500 g, with g. A sample of 16 averages 497 g. Test against at .
Standard error , so . The two-tailed p-value is . Since , reject : the evidence suggests the mean differs from 500 g.
Example 2
A test gives . A student concludes that is true. Is that right?
A large p-value seems to confirm the null hypothesis.
It does not prove it. A p-value of 0.30 means the data are not unusual if is true, so there is not enough evidence against it. The correct conclusion is "fail to reject ". The effect might exist but be too small for this sample to detect.
Example 3
In Example 1, would the decision change at ?
Yes. , so would not be rejected at the stricter level.
Example 4
A right-tailed test gives . Find the p-value and decide at .
. Since , reject .
Example 5
A drug trial tests whether a drug lowers blood pressure. Write and .
With the mean change, and , a left-tailed test.
Example 6
In a test with and true, how often will the test wrongly reject in the long run?
About 5 percent of the time. That is what the significance level means.
Why Hypothesis Testing Matters
It turns "is this difference real?" into a decision with a known error rate.
- It controls false alarms. The significance level fixes how often a true is wrongly rejected.
- It is used everywhere. Medicine, manufacturing, psychology and economics all rely on it.
- It separates signal from noise. Small samples vary, and the test asks whether a result goes beyond that variation.
- It makes reasoning transparent. Stating , and the test in advance lets others check the logic.
The NIST/SEMATECH What are statistical tests? page describes testing in the same structure: a null hypothesis, an alternative, a test statistic and a critical region chosen to control the risk of a Type I error.
What Most Guides Get Wrong About Hypothesis Testing
Two misunderstandings are common.
The first is the meaning of the p-value. It is often described as "the probability that is true", which it is not. It is the probability of data this extreme if were true. The two can differ enormously, as Bayes' theorem shows.
The second is "accepting" the null hypothesis. Example 2 shows why a test only ever fails to reject. Absence of evidence against is not evidence for it, especially with small samples.
Where Students Trip Up on Hypothesis Testing
Mistake 1: Accepting H₀
Where it slips in: Conclusions with large p-values, as in Example 2.
Don't do this: Writing " is true" or "accept ".
The correct way: Write "fail to reject ; there is not enough evidence for ".
Students write "accept" because the test seems to have two outcomes, reject and its opposite, and accept sounds like the natural opposite.
Mistake 2: Choosing the tail after seeing the data
Where it slips in: One-tailed tests.
Don't do this: Switching to a one-tailed test because the two-tailed p-value was just above 0.05.
The correct way: Choose the alternative hypothesis, and so the tails, before collecting data.
Mistake 3: Confusing significance with importance
Where it slips in: Large samples.
Don't do this: Treating a tiny but significant difference as a big effect.
The correct way: Report the size of the difference alongside the p-value.
The cost of the third mistake shows up in published research. With very large samples, even trivial differences become statistically significant, which is why many journals now ask authors to report effect sizes and confidence intervals, not only p-values.
The Short Version
- Hypothesis testing judges a claim about a population using a sample.
- It assumes and rejects it only if the p-value is at most .
- Tails follow from the alternative hypothesis, chosen in advance.
- Tests can make Type I and Type II errors, and a large p-value never proves .
- To work through statistics with a teacher, explore Bhanzu's high school math tutor sessions or online math tutoring.
Read More
Research Behind This Article
- OpenStax, Introductory Statistics 2e, 9.1 Null and Alternative Hypotheses (2023). openstax.org
- OpenStax, Introductory Statistics 2e, 9.2 Outcomes and the Type I and Type II Errors (2023). openstax.org
- OpenStax, Introductory Statistics 2e, 9.4 Rare Events, the Sample, and the Decision and Conclusion (2023). openstax.org
- NIST/SEMATECH, e-Handbook of Statistical Methods, 7.1.3.1 Critical values and p values (2022). itl.nist.gov
- OpenStax, Introductory Statistics 2e, 9.6 Hypothesis Testing of a Single Mean and Single Proportion (2023). openstax.org
Quick Quiz: Check Yourself
Three levels, fresh numbers every time, instant feedback with the working.
Was this article helpful?
Your feedback helps us write better content
Frequently Asked Questions
What is hypothesis testing?
What are the steps of hypothesis testing?
What is a p-value in hypothesis testing?
What is the difference between one-tailed and two-tailed tests?
What are Type I and Type II errors?
