This free t-test calculator runs a one-sample, two-sample (Welch) or paired t test from summary statistics or raw data. It gives statistics and AP® Statistics students t, the degrees of freedom, the p-value, a shaded t curve, the decision, a conclusion in context and the TI-84 steps.
Loading the t-test calculator…
How to use the t-test calculator
- Choose the test. One-sample compares one mean to a claimed value. Two-sample compares the means of two independent groups. Paired compares two measurements on the same subjects, using their differences.
- Set the hypotheses. Enter the value in H₀ (μ₀, or the hypothesized difference, usually 0) and pick the alternative: ≠, < or >. Choose α: 0.10, 0.05, 0.01 or a custom level.
- Enter the data. Type the sample mean, standard deviation and size, or switch to Raw data and paste your values.
- Read the result. You get t, df and the p-value, a t curve with the p-value shaded, the decision, a conclusion (type the variable name to fill in its blank), the conditions checklist and the steps.
Worked example
A snack company says its bags of chips hold 50 grams on average. A consumer group weighs a random sample of 25 bags and finds x̄ = 52 grams with s = 5 grams. At α = 0.05, is there convincing evidence that the true mean weight is different from 50 grams?
- State the hypotheses. H₀: μ = 50 and Hₐ: μ ≠ 50, where μ is the true mean weight of the company’s bags, in grams.
- Check the conditions. Random: the bags were randomly selected. 10%: 25 bags is far less than 10% of all bags made. Normal: n = 25 is under 30, so we need the weights to be roughly normal; a dotplot with no strong skew or outliers would support that.
- Find the test statistic. SE = s ÷ √n = 5 ÷ √25 = 1, so t = (52 − 50) ÷ 1 = 2.00, with df = 25 − 1 = 24.
- Find the p-value. For a two-sided test, p = 2 × P(T ≥ 2.00) = 2 × 0.0285 = 0.0569.
- Decide. 0.0569 is greater than α = 0.05, so we fail to reject H₀.
Conclusion: Because the p-value (0.0569) is greater than α = 0.05, we fail to reject H₀. We do not have convincing evidence that the true mean weight of the company’s bags is different from 50 grams. On a TI-84, T-Test with Inpt = Stats, μ0 = 50, x̄ = 52, Sx = 5, n = 25 and μ: ≠μ0 gives the same t and p-value.
The four steps of a significance test
AP® Statistics free-response questions expect every significance test to follow the same four parts:
- State the hypotheses, the significance level and the parameter in context: “μ is the true mean weight of the bags.”
- Plan: name the procedure (one-sample t test for a mean, for example) and check its conditions.
- Do: calculate the test statistic, df and p-value.
- Conclude: compare the p-value to α, make a decision, and state the conclusion in context.
The calculator handles the “Do” step and drafts the other three, but you still need to describe the parameter and justify the conditions in your own words.
Which t test should you use?
| Situation | Test | Test statistic | df |
|---|---|---|---|
| One sample, compared to a claimed mean | One-sample t | t = (x̄ − μ₀) ÷ (s/√n) | n − 1 |
| Two measurements on the same subjects, or matched pairs | Paired t | t = (d̄ − μ₀) ÷ (s_d/√n) | n − 1 (n = pairs) |
| Two independent groups | Two-sample t (Welch) | t = ((x̄₁ − x̄₂) − Δ₀) ÷ √(s₁²/n₁ + s₂²/n₂) | Welch formula |
The most common mix-up is between paired and two-sample tests. If each value in one list belongs with a specific value in the other (the same student before and after tutoring, the left and right hands of one person), the data are paired: subtract within each pair and test the differences. If the two groups are separate people or objects with no natural matching, use the two-sample test. Choosing the wrong one changes the standard error and can change the decision.
What the p-value tells you
The p-value is the probability of getting a test statistic at least as extreme as yours, assuming the null hypothesis is true. On the calculator’s t curve, it’s the shaded area beyond your t.
- For Hₐ: μ > μ₀, shade to the right of t. For Hₐ: μ < μ₀, shade to the left.
- For Hₐ: μ ≠ μ₀, shade both tails beyond |t|, so the p-value is twice the one-tail area.
That is why the alternative must be chosen before you look at the data. In the chips example, a one-sided test (Hₐ: μ > 50) would give p = 0.0285 and a rejection at α = 0.05, while the two-sided test the question calls for gives 0.0569. A small p-value means the sample would be surprising if H₀ were true. It is not the probability that H₀ is true, and a large p-value doesn’t prove H₀.
Making the decision
Compare the p-value with the significance level α, chosen before collecting data:
- p < α: reject H₀. There is convincing evidence for Hₐ.
- p ≥ α: fail to reject H₀. There is not convincing evidence for Hₐ.
Never write “accept H₀.” Failing to reject means the data are consistent with H₀, not that H₀ has been shown true. The choice of α is a trade-off: α is the probability of a Type I error (rejecting a true H₀), so a smaller α makes that mistake less likely but makes a Type II error (missing a real difference) more likely.
Summary statistics or raw data?
Most textbook and AP problems give summary statistics: a mean, a standard deviation and a sample size. When you have the actual measurements instead, paste them into Raw data and the calculator finds x̄ and s for you, using the sample standard deviation (dividing by n − 1), the same value a TI-84 reports as Sx. For paired data, enter the two lists in the same order; the calculator subtracts first − second and shows the differences before testing them.
Conditions for a t test
- Random: a random sample, or random assignment in an experiment (for paired data, random assignment of the order or the treatment within each pair).
- 10%: when sampling without replacement, each sample is at most 10% of its population.
- Normal/Large Sample: each sample has n ≥ 30, or the population (of differences, for paired data) is approximately normal. With small samples, graph the data and look for strong skew or outliers.
With raw data, the calculator flags outliers by the 1.5 × IQR rule, because a single extreme value can distort x̄ and s enough to change the result.
Writing the conclusion
A complete conclusion links the p-value to α, makes the decision, and answers the question in context, without claiming certainty:
Because the p-value (___) is [less / greater] than α = ___, we [reject / fail to reject] H₀. We [have / do not have] convincing evidence that the true mean ___ is [greater than / less than / different from] ___.
The calculator fills this in for you; type the variable name, like “weight of the bags (grams)”, to replace the blank. Avoid words like “prove,” and keep the conclusion about the population parameter, not the sample.
t tests on the AP® Statistics exam
t tests for means are part of AP® Statistics Unit 7, Inference for Quantitative Data: Means, and they appear on most free-response sections. For more practice, read Carrying Out a Test for a Population Mean or Mean Difference, Carrying Out a Test for the Difference of Two Population Means and Interpreting p-Values, and browse the AP® Statistics cheat sheets. After a practice test, estimate your score with the AP® Statistics Score Calculator.
FAQ
How do you calculate a t-test by hand?
Find the test statistic t = (statistic − hypothesized value) ÷ standard error. For one sample, that is t = (x̄ − μ₀) ÷ (s/√n), with df = n − 1. Then find the p-value from the t distribution with those degrees of freedom. For x̄ = 52, μ₀ = 50, s = 5 and n = 25, t = 2 ÷ 1 = 2.00 with df = 24, and the two-sided p-value is 0.0569.
What does the p-value mean?
The p-value is the probability of getting a sample result at least as extreme as yours if the null hypothesis were true. A small p-value means your result would be unusual if H₀ were true, which is evidence against H₀. It is not the probability that H₀ is true.
When do I reject the null hypothesis?
Reject H₀ when the p-value is less than the significance level α (usually 0.05). Otherwise, fail to reject H₀. Never say you accept H₀: failing to reject only means the data don’t give convincing evidence against it.
Should I use a paired or a two-sample t-test?
Use a paired test when each value in one group is naturally matched with one in the other, like before-and-after scores for the same students or twins split between treatments. Analyze the differences with a one-sample t-test. Use a two-sample test when the groups are independent, with no natural pairing.
What is Welch’s t-test?
Welch’s two-sample t-test doesn’t assume the two populations have equal standard deviations. It uses SE = √(s₁²/n₁ + s₂²/n₂) and a special degrees-of-freedom formula that often gives a decimal df. It is what AP® Statistics expects and what the TI-84 does with Pooled = No.
One-sided or two-sided?
Choose the alternative hypothesis before you look at the data, based on the question. If it asks whether the mean is different from a value, use ≠ (two-sided). If it asks whether the mean is greater than or less than a value, use > or <. A two-sided p-value is twice the one-sided p-value for the same t.