A hypothesis test turns your sample into a test statistic, then into a p-value. If the p-value is at or below alpha, you reject H0. For a mean of 52 against mu0 = 50 with sigma = 8 and n = 64, z = 2.00 and p = 0.0455, so you reject H0 at the 5% level.
Calculations run in your browser. Inputs are not sent to our servers; anything you Save stays in this browser only.
Saved results (0)
How to Use the Calculator
- Pick the test type. Use the z-test when sigma is known, the t-test when you only have s, and the proportion test for yes or no data.
- Type your sample numbers and the value from your null hypothesis, such as mu0 = 50 or p0 = 0.5.
- Choose the alternative hypothesis: not equal, less than, or greater than. Then set alpha, which is usually 0.05.
- Read the decision at the top. The cards show the test statistic, standard error, p-value, critical values and a plain-language conclusion.
- Check the chart. The shaded tails are the rejection region, and the dashed line is your test statistic.
If the dashed line lands inside a shaded tail, the p-value is below alpha and you reject H0.
The Five Steps of a Hypothesis Test
Every test in this calculator follows the same five steps. Only the formula for the test statistic changes.
Step 1: State H0 and H1
The null hypothesis H0 says nothing has changed. The alternative H1 is the claim you want evidence for.
Step 2: Choose Alpha
Alpha is the risk you accept of rejecting a true H0. Pick it before you collect data. The value 0.05 is the most common choice.
Step 3: Compute the Test Statistic
The statistic counts how many standard errors your sample sits from the H0 value.
Step 4: Find the p-Value
The p-value is the tail area beyond your statistic. A two-sided test counts both tails.
Step 5: Decide and Explain
Reject H0 if p is less than or equal to alpha. Otherwise, fail to reject H0. Then write the result in plain words about the real question.
Worked Example
A sample of 64 parts has a mean of 52. The target is 50, and sigma is 8. The standard error is 8 / sqrt(64) = 1, so z = (52 - 50) / 1 = 2.00. The two-sided p-value is 2 x 0.02275 = 0.0455. That is below 0.05, so we reject H0.
Choosing a z-Test, t-Test or Proportion Test
The right test depends on the kind of data you have and what you know about the population.
| Test | Use it when | Distribution |
|---|---|---|
| One-sample z-test | You test a mean and know the population SD, sigma. | Standard normal |
| One-sample t-test | You test a mean and only have the sample SD, s. | t with n - 1 df |
| One-proportion z-test | You test a share of yes results, like 58 of 100. | Standard normal (approximate) |
In real studies, sigma is rarely known. So the t-test is usually the right choice for a mean. The t curve has fatter tails, which makes it a little harder to reject H0 with small samples.
The proportion test needs enough data on both sides. Check that n x p0 and n x (1 - p0) are both at least 10. The calculator warns you when this check fails.
One-Sided vs Two-Sided Tests
A two-sided test asks whether the true value is different in either direction. Alpha is split, so each tail holds alpha / 2.
A one-sided test asks about one direction only, such as greater than. All of alpha sits in one tail, so the critical value is closer to zero.
| H1 | Tail | Critical z at alpha = 0.05 |
|---|---|---|
| mu is not equal to mu0 | Both tails | -1.960 and +1.960 |
| mu < mu0 | Left tail | -1.645 |
| mu > mu0 | Right tail | +1.645 |
Use a one-sided test only when a result in the other direction would not matter to you. That choice has to come from your question, not from your data.
Type I and Type II Errors
Any test decision can be wrong. There are two ways it can happen.
| H0 is true | H0 is false | |
|---|---|---|
| Reject H0 | Type I error (chance = alpha) | Correct decision (power) |
| Fail to reject H0 | Correct decision | Type II error (chance = beta) |
A smaller alpha cuts Type I errors but raises the chance of a Type II error. A larger sample lowers both. Our sample size calculator helps you plan that.
Common Mistakes
1. Saying You Accept H0
A large p-value only means the data are not strong enough to reject H0. It does not prove H0 is true. Say you fail to reject H0 instead.
2. Picking One-Sided After Seeing the Data
Switching to a one-sided test because the sample leaned one way halves the p-value. That doubles your real Type I error rate. Choose the direction before you collect data.
3. Reading p as the Chance H0 Is True
The p-value assumes H0 is true and asks how rare your data are. It is not the probability that H0 is true or false.
4. Using z When sigma Is Unknown
Putting s into the z formula makes p-values too small with small samples. Use the t-test when you estimate the SD from the sample.
5. Confusing Significant With Important
With a huge sample, a tiny difference can be significant. Always ask whether the size of the difference matters in practice.
How We Calculate
Frequently Asked Questions
What is a hypothesis test?
A hypothesis test is a way to check a claim about a population with sample data. You start by assuming the null hypothesis is true. Then you ask how surprising your sample would be under that assumption. A very surprising sample is evidence against the null hypothesis.
What does the p-value tell me?
The p-value is the chance of getting a result at least as extreme as yours if the null hypothesis were true. A small p-value means your data would be rare under H0. It is not the chance that H0 is true.
When do I reject the null hypothesis?
Reject H0 when the p-value is less than or equal to your significance level, alpha. With alpha = 0.05, a p-value of 0.0455 leads to rejecting H0. A p-value of 0.1096 does not.
Should I use a z-test or a t-test?
Use a z-test for a mean only when you know the population standard deviation, sigma. In most real studies sigma is unknown, so you use the sample standard deviation s and a t-test with n - 1 degrees of freedom.
Why do we say fail to reject instead of accept?
A test can only measure evidence against H0. A large p-value means the data do not rule H0 out, but it does not prove H0 is true. A small sample can miss a real effect, so accepting H0 would claim too much.
What is the difference between a one-tailed and a two-tailed test?
A two-tailed test looks for a difference in either direction, so alpha is split between both tails. A one-tailed test looks in one direction only. Choose the direction before you look at the data, based on your research question.
What sample size do I need for a proportion test?
The normal approximation works well when n times p0 and n times (1 - p0) are both at least 10. For p0 = 0.5 that means at least 20 people. If the check fails, an exact binomial test is the safer choice.
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods, section 1.3.5: Quantitative Techniques (significance levels, critical regions and test statistics).
- NIST/SEMATECH e-Handbook, section 7.2.2: Are the data consistent with the assumed process mean? (one-sample tests of a mean and one-sided hypotheses).
- NIST/SEMATECH e-Handbook, section 7.2.4: Does the proportion of defectives meet requirements? (one-proportion test).
- OpenStax. Introductory Statistics 2e, chapter 9: Hypothesis Testing with One Sample (null and alternative hypotheses, Type I and Type II errors).
- Penn State STAT 500, Lesson 6: Hypothesis Testing (one-sample proportion and mean tests, rejection regions and p-values).
- Penn State STAT 200, Lesson 8: Inference for One Sample (the n p0 and n (1 - p0) at least 10 condition).
- Penn State STAT 200, Lesson 6: Hypothesis Testing, Part 2 (Type I and Type II errors, significance levels and power).
Related Guides
Related Calculators
Looking for more math tools?
Explore all math calculatorsThis calculator runs one-sample z-tests and t-tests for a mean and the one-proportion z-test. It assumes a random sample, and the proportion test uses the normal approximation. Results are for learning and planning; check important decisions with a statistician. Spotted an error? Let us know.
Author
Shakeel Muzaffar is the Founder and Editor-in-Chief of MultiCalculators.com, bringing over 15 years of experience in digital publishing, product strategy, and online tool development. He leads the platform's editorial vision, ensuring every calculator meets strict standards for accuracy, usability, and real-world value. Shakeel personally oversees content quality, formula verification workflows, and the platform's commitment to publishing tools that are genuinely useful for students, professionals, and everyday users worldwide.




