What is a T-Test Calculator?
A t-test (Student’s t-test) compares means when the population standard deviation is unknown. Use the one-sample test to compare one mean with a fixed value, the two-sample (pooled) or Welch’s test to compare two independent groups, and the paired test for before-and-after or matched data. Each one divides a difference by its standard error, t = difference / SE, and reads the p-value from the t distribution with the right degrees of freedom.
What the T-Test Calculator does
This free t test calculator runs all four common t-tests from one form, so it works as a Student t test calculator, a Welch calculator and a paired t-test calculator in one. Pick the test type, enter summary statistics (mean, standard deviation and sample size) or paste raw data, and it will calculate the t-statistic, the degrees of freedom, the p-value, the critical value and the reject or fail-to-reject decision. Every test also reports Cohen’s d and a 95% confidence interval for the difference, draws the t distribution with the rejection region shaded, and shows each step with your numbers.
Choosing the right t-test depends on the study design, not on the numbers. Ask two questions: how many groups are there, and are the observations in different groups linked? The table in the next section answers both. For proportions, more than two groups or non-normal data, the How to Choose the Right Statistical Test guide covers the alternatives.
How to use the T-Test Calculator
- Choose the Test type that matches your design. If you are unsure, use the decision table below: one group against a standard, two separate groups, or the same subjects measured twice.
- Select the alternative hypothesis (two-tailed, left-tailed or right-tailed) and the significance level α.
- Pick Summary statistics if you only have the mean, SD and n for each group, or Raw data to paste the values. A one-sample test also needs the hypothesized mean μ₀.
- Read t, df, the p-value and the decision, then open the step-by-step solution to see the standard error, the effect size and the confidence interval.
Which t-test should I use?
Match the test to how the data were collected. Start with the design question: are you comparing one group to a standard, two separate groups, or before-and-after data? Then check what you have: raw data points or summary numbers (mean and standard deviation). This calculator accepts either for every test. Check the assumptions near the end of the page before you rely on the p-value.
| Design | Test | Example |
|---|---|---|
| One sample vs a known value | One-sample t-test | Average fill volume vs the 250 ml label |
| Two separate groups, similar SDs | Two-sample (pooled) t-test | Exam scores for two classes taught the same way |
| Two separate groups, SDs or sizes differ | Welch’s t-test | Delivery times from two couriers |
| Same subjects measured twice, or matched pairs | Paired t-test | Blood pressure before and after treatment |
Paired or independent? The most common t-test mistake
Data are paired when each value in one column belongs with one value in the other: the same person before and after, two measurements on the same item, or twins split between treatments. Data are independent when the two groups contain different subjects and the order of rows means nothing.
Using the wrong test changes the standard error, not just the label. A paired test removes the subject-to-subject variation, so on genuinely paired data it is usually far more sensitive. Running an independent test on paired data throws that away and can miss a real effect; running a paired test on unrelated groups invents a pairing and gives a meaningless p-value. If the two columns can have different lengths, the data are not paired. For matched data with a differences table and Cohen’s d_z, use the Paired t-Test Calculator; for two separate groups with Levene’s test, use the Independent Samples t-Test Calculator.
One-tailed vs two-tailed t-test
A two-tailed test asks whether the means differ in either direction and splits α across both tails. A one-tailed test asks only whether the mean is higher, or only whether it is lower, and puts all of α in one tail. When the sample falls in the predicted direction, the one-tailed p-value is half the two-tailed one.
With this calculator’s one-sample defaults (x̄ = 52.3, s = 6.4, n = 30, μ₀ = 50), t = 1.9684 with df = 29. The two-tailed p is 0.0586, which is not significant at α = 0.05, while the right-tailed p is 0.0293, which is. The right-tailed critical value is 1.6991 instead of ±2.0452. That is why the direction must be fixed before you see the data: switching to one tail afterwards doubles the real false-positive rate.
T-test formulas
All four tests share one structure, t = (observed − hypothesized) / standard error. They differ in how the standard error and the degrees of freedom are calculated.
| Symbol | Meaning |
|---|---|
| x̄, s, n | sample mean, standard deviation and size |
| μ₀ | hypothesized mean |
| sₚ | pooled standard deviation, √{[(n₁ − 1)s₁² + (n₂ − 1)s₂²] / (n₁ + n₂ − 2)} |
| d̄, s_d | mean and SD of the paired differences |
| d | Cohen’s d: the difference in standard-deviation units (d_z for paired data) |
The p-value is the probability, if H₀ is true, of a t statistic at least as extreme as the one observed. Critical values come from the t-table or the T Critical Value Calculator.
Sources: NIST/SEMATECH e-Handbook, Two-Sample t-Test for Equal Means; NIST/SEMATECH e-Handbook, section 7.2.2 (one-sample test of a mean); Student (1908), The probable error of a mean, Biometrika 6(1); Welch (1947), The generalization of “Student’s” problem, Biometrika 34(1–2).
Worked example: two-sample t-test
Comparing two teams’ task times
Problem. Team 1 (n₁ = 25) finished a task in a mean of 14.2 minutes (s₁ = 3.1); team 2 (n₂ = 28) took 12.6 minutes (s₂ = 2.8). The teams are different people and the SDs are similar, so use the pooled two-sample t-test at α = 0.05. These are the calculator’s two-sample defaults; choose Two-sample t-test (pooled) to follow along.
- 01Hypotheses: H₀: μ₁ − μ₂ = 0, H₁: μ₁ − μ₂ ≠ 0.
- 02Pooled variance: sₚ² = [24(3.1²) + 27(2.8²)] / 51 = (230.64 + 211.68) / 51 = 8.6729, so sₚ = 2.9450.
- 03SE = 2.9450 × √(1/25 + 1/28) = 0.8103; t = (14.2 − 12.6) / 0.8103 = 1.9745 with df = 51.
- 04Two-tailed p-value ≈ 0.0538; the critical values are ±2.0076.
- 05Effect size: d = 1.6 / 2.9450 = 0.54 (medium). 95% CI for μ₁ − μ₂: 1.6 ± 2.0076 × 0.8103 = (−0.03, 3.23), which just includes 0.
- 06Welch’s test on the same numbers gives t = 1.9629, df = 48.72 and p ≈ 0.0554, the same conclusion.
Answer. p ≈ 0.054 is just above 0.05, so fail to reject H₀. The 1.6-minute difference is a medium effect but not statistically significant at the 5% level; a larger sample would be needed to pin it down.
How to interpret t-test results
To report a result, give the test, t with its degrees of freedom, p, the effect size and the interval, for example: “Welch’s t-test, t(48.72) = 1.96, p = .055, d = 0.54, 95% CI [−0.04, 3.24].”
- t statistic: the observed difference measured in standard errors. A t of 2 means the difference is about twice its standard error; its sign shows the direction.
- p-value: if p ≤ α, reject H₀ and conclude the means differ. If p > α, the data do not show a difference, which is not proof that the means are equal.
- Critical value: the cut-off from the t distribution. |t| beyond it gives the same decision as p ≤ α.
- Cohen’s d: the size of the difference in standard-deviation units, about 0.2 small, 0.5 medium and 0.8 large. A big sample can make a tiny, unimportant difference significant, so read d next to p.
- 95% confidence interval: the plausible range for the true difference. If it excludes 0, the two-tailed test at α = 0.05 is significant.
Worked examples: one-sample and paired t-tests
One-sample. A sample of n = 30 has x̄ = 52.3 and s = 6.4. Test H₀: μ = 50 at α = 0.05 (these are the calculator’s one-sample defaults). SE = 6.4 / √30 = 1.1685, so t = (52.3 − 50) / 1.1685 = 1.9684 with df = 29. The two-tailed p = 0.0586 is above 0.05, so fail to reject H₀. Cohen’s d = 2.3 / 6.4 = 0.36 (small), and the 95% CI for μ, (49.91, 54.69), includes 50.
Paired. Fifteen subjects were measured before and after, with mean difference d̄ = 1.8 and s_d = 2.9 (the paired summary defaults). SE = 2.9 / √15 = 0.7488, so t = 1.8 / 0.7488 = 2.4039 with df = 14. The two-tailed p = 0.0306 is below 0.05 and |t| exceeds the critical value 2.1448, so reject H₀. Cohen’s d_z = 1.8 / 2.9 = 0.62 (medium), and the 95% CI for the mean change is (0.194, 3.406), which excludes 0.
T-tests in R, Excel, Python and the TI-84
All of these use the same formulas as this calculator, so t and the p-value should match to rounding.
- R:
t.test(x, mu = 50)for one sample;t.test(x, y)runs Welch by default, addvar.equal = TRUEfor the pooled test, orpaired = TRUEfor paired data. - Excel:
=T.TEST(a, b, tails, type)returns the p-value, with type 1 for paired, 2 for pooled and 3 for Welch. It does not return t or df. - Python (SciPy):
ttest_1samp,ttest_ind(passequal_var=Falsefor Welch) andttest_relfor paired data, all inscipy.stats. - TI-84: STAT → TESTS → T-Test (one sample) or 2-SampTTest, where Pooled: Yes gives the pooled test and No gives Welch.
Common use cases
- Comparing a sample mean with a target, specification or published norm (one-sample).
- Comparing treatment and control groups in an experiment (two-sample or Welch).
- Evaluating a change measured on the same people before and after an intervention (paired).
- Checking A/B test results on continuous metrics such as order value or time on task.
- Choosing between tests: the overview of types of statistical tests sets t-tests beside correlation, regression, chi-square and nonparametric tests.
Assumptions and limitations
- Independent observations. Each value comes from a different subject or unit (for the paired test, each pair is independent of the other pairs). Repeated measurements of the same person in one group break this.
- A numeric outcome. The variable is measured on an interval or ratio scale, such as time, weight or a test score. For yes/no outcomes, use the Two Proportion Z-Test Calculator.
- Approximately normal data. The values in each group, or the paired differences, should be roughly normal. With about 30 or more per group, moderate skew is tolerated; with small samples, check a histogram or run the Shapiro–Wilk Test Calculator.
- Equal variances, for the pooled test only. The pooled two-sample test assumes both populations have the same variance. Welch’s test drops this assumption, which is why it is the safer default for two independent groups. The Levene’s Test Calculator checks it.
- For more than two groups, running many t-tests inflates the false-positive rate; use one-way ANOVA instead.
- If σ is known, use the Z-Test Calculator. For proportions (percentages of yes/no outcomes), use the Two Proportion Z-Test Calculator or the Chi-Square Test of Independence Calculator.
- For small, skewed samples or ordinal data, rank-based tests (Mann–Whitney for independent groups, Wilcoxon signed-rank for pairs) are more reliable.
- A significant p-value says a difference is unlikely to be zero, not that it is large or important. Report the effect size and the confidence interval alongside it.
Frequently asked questions
What are the main types of t-test?
How do you calculate a t-test?
Can I run a t-test with only the mean and standard deviation?
Should I use the pooled two-sample t-test or Welch’s t-test?
What does the t value mean?
What is a significant t-test result?
How large a sample do I need for a t-test?
Cite this page
Statculator. (2026, November 14). T-Test Calculator. Retrieved November 14, 2026, from https://statculator.com/hypothesis-tests/t-test-calculator/