📐 T-Test Calculator
Perform one-sample or two-sample t-tests. Calculates t-statistic, degrees of freedom, p-value (two-tailed), and hypothesis test decision at α = 0.05.
Group 1
Group 2
What is a T-Test?
A t-test is a statistical hypothesis test used to determine whether the means of one or two groups are significantly different from each other (or from a known value), given the variability within the data. Developed by William Sealy Gosset (writing under the pseudonym "Student") in 1908 while working at the Guinness Brewery, the Student's t-test was designed for small sample sizes where the population standard deviation is unknown — the most common situation in real research. It is one of the most widely used statistical tests in science, medicine, social research, quality control, and business analytics.
There are three main variants: the one-sample t-test (comparing a sample mean to a known or hypothesised population mean), the independent samples t-test (comparing the means of two separate, unrelated groups), and the paired samples t-test (comparing means from the same group measured at two different times or under two different conditions). The paired t-test is particularly powerful for before-after studies (drug treatment efficacy, training programme outcomes, process improvement) because it controls for individual variability by comparing each subject's change rather than the group averages.
The t-test produces a t-statistic and an associated p-value — the probability of observing the measured difference (or a more extreme one) if the null hypothesis (no real difference) were true. A p-value below the chosen significance level (conventionally 0.05 or 5%) leads to rejection of the null hypothesis — the difference is considered statistically significant. Crucially, statistical significance does not imply practical importance: a very large sample can produce a statistically significant but trivially small difference. Researchers should report effect size (Cohen's d) alongside the p-value to provide a complete picture of both the significance and the magnitude of any difference found.
T-Test Formulas
How to Use This T-Test Calculator
-
1Select Test TypeChoose one-sample to compare a sample mean to a known value, or two-sample to compare two independent groups.
-
2Enter Summary StatisticsProvide the mean, standard deviation, and sample size for each group.
-
3Read the ResultsThe calculator shows the t-statistic, degrees of freedom, and approximate two-tailed p-value.
-
4Interpret the DecisionIf p < 0.05, reject H₀ — the difference is statistically significant at the 5% level.
How the T-Test Calculator Works
Formula, assumptions, and calculation steps for this statistics tool.
Methodology
Statistics calculators organize sample data, apply the selected descriptive or inferential formula, and report the statistic with interpretation.
Calculation Steps
- Enter raw values or summary statistics.
- Clean separators and count the sample size.
- Apply the relevant statistic, probability, or confidence formula.
- Display the result with context such as degrees of freedom, percentile, or strength.
Assumptions and Limits
- Samples should be representative of the population being studied.
- Normality or independence assumptions apply only where the selected method requires them.
- Rounded results may differ slightly from spreadsheet software.
Frequently Asked Questions
A t-test is a statistical hypothesis test used to determine whether there is a significant difference between the means of two groups, or between a sample mean and a known value. It is appropriate when sample sizes are small or the population standard deviation is unknown.
The p-value is the probability of obtaining a t-statistic as extreme as (or more extreme than) the observed one, assuming the null hypothesis is true. A p-value below 0.05 is conventionally considered statistically significant.
Use a one-sample t-test when comparing a sample mean to a hypothesized population mean. Use a two-sample t-test when comparing the means of two independent groups.
Welch's t-test is a variant of the two-sample t-test that does not assume equal variances between groups. It uses a modified degrees of freedom (Welch–Satterthwaite) and is generally preferred over Student's t-test.
Degrees of freedom (df) determine the shape of the t-distribution used to compute the p-value. For a one-sample test, df = n − 1. For a two-sample Welch test, df is estimated from both sample sizes and standard deviations.
Real-World Applications
Common Mistakes
T-Test Variant Selection Guide
| Test Type | When to Use | Example |
|---|---|---|
| One-sample t-test | Sample mean vs. known value | Is class avg score ≠ 75? |
| Independent t-test | Two separate groups | Drug A group vs. Drug B group |
| Welch's t-test | Two groups, unequal variance | Salary: male vs. female employees |
| Paired t-test | Same subjects, two conditions | Blood pressure before vs. after |
References
- Gosset, W.S. ("Student"). "The Probable Error of a Mean." Biometrika, 1908.
- Cohen, J. Statistical Power Analysis for the Behavioral Sciences. Lawrence Erlbaum, 1988.
- Field, A. Discovering Statistics Using IBM SPSS Statistics. Sage, 2018.
- Montgomery, D.C. and Runger, G.C. Applied Statistics and Probability for Engineers. Wiley, 2018.
- Ioannidis, J.P.A. "Why Most Published Research Findings Are False." PLoS Medicine, 2005.
Related Calculators
Browse all Statistics calculators →Chi Square Calculator
Calculate chi-square test statistic, p-value, and degrees of freedom for goodness of fit and independence tests.
ANOVA Calculator
Perform one-way ANOVA test to compare means across multiple groups.
Confidence Interval Calculator
Calculate confidence intervals for means and proportions.